struct lookup_intent *lld_it;
#endif
unsigned int lld_sa_generation;
+ cfs_list_t lld_sa_alias;
};
#define ll_d2d(de) ((struct ll_dentry_data*)((de)->d_fsdata))
struct obd_capa *lli_mds_capa;
cfs_list_t lli_oss_capas;
- /* metadata stat-ahead */
+ /* metadata statahead */
+ /* protect statahead stuff: lli_opendir_pid, lli_opendir_key, lli_sai,
+ * lli_sa_dentry, and so on. */
+ cfs_spinlock_t lli_sa_lock;
/*
* "opendir_pid" is the token when lookup/revalid -- I am the owner of
* dir statahead.
* before child -- it is me should cleanup the dir readahead. */
void *lli_opendir_key;
struct ll_statahead_info *lli_sai;
+ cfs_list_t lli_sa_dentry;
struct cl_object *lli_clob;
/* the most recent timestamps obtained from mds */
struct ost_lvb lli_lvb;
}
struct it_cb_data {
- struct inode *icbd_parent;
+ struct inode *icbd_parent;
struct dentry **icbd_childp;
- obd_id hash;
+ obd_id hash;
+ struct inode **icbd_alias;
+ __u32 *bits;
};
__u32 ll_i2suppgid(struct inode *i);
#endif
void ll_lookup_it_alias(struct dentry **de, struct inode *inode, __u32 bits);
int ll_lookup_it_finish(struct ptlrpc_request *request,
- struct lookup_intent *it, void *data,
- struct inode **alias);
+ struct lookup_intent *it, void *data);
/* llite/rw.c */
int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
void ll_intent_drop_lock(struct lookup_intent *);
void ll_intent_release(struct lookup_intent *);
int ll_drop_dentry(struct dentry *dentry);
-extern void ll_set_dd(struct dentry *de);
+extern int ll_set_dd(struct dentry *de);
int ll_drop_dentry(struct dentry *dentry);
void ll_unhash_aliases(struct inode *);
void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
unsigned int sai_skip_hidden;/* skipped hidden dentry count */
unsigned int sai_ls_all:1; /* "ls -al", do stat-ahead for
* hidden entries */
+ unsigned int sai_nolock; /* without lookup lock case */
cfs_waitq_t sai_waitq; /* stat-ahead wait queue */
struct ptlrpc_thread sai_thread; /* stat-ahead thread */
cfs_list_t sai_entries_sent; /* entries sent out */
if (lli->lli_opendir_pid != cfs_curproc_pid())
return;
- cfs_spin_lock(&lli->lli_lock);
+ cfs_spin_lock(&lli->lli_sa_lock);
if (likely(lli->lli_sai != NULL && ldd != NULL))
ldd->lld_sa_generation = lli->lli_sai->sai_generation;
- cfs_spin_unlock(&lli->lli_lock);
+ cfs_spin_unlock(&lli->lli_sa_lock);
}
static inline
return do_statahead_enter(dir, dentryp, lookup);
}
-static void inline ll_dops_init(struct dentry *de, int block)
+static int inline ll_dops_init(struct dentry *de, int block)
{
struct ll_dentry_data *lld = ll_d2d(de);
+ int rc = 0;
if (lld == NULL && block != 0) {
- ll_set_dd(de);
+ rc = ll_set_dd(de);
+ if (rc)
+ return rc;
+
lld = ll_d2d(de);
}
lld->lld_sa_generation = 0;
de->d_op = &ll_d_ops;
+ return rc;
}
/* llite ioctl register support rountine */