X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fstatahead.c;h=5cf4b9c88cc52400505ae673414d6a2f2d9078cd;hb=b58a81067237f398f735f85b2211431cfc37493a;hp=d911ab6aaaba618faa154e96ea41c3fc7acdaa23;hpb=d10c9e05ab593f361fdfd27842766a1924e63e58;p=fs%2Flustre-release.git diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index d911ab6..5cf4b9c 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -84,7 +83,7 @@ struct ll_sa_entry { }; static unsigned int sai_generation = 0; -static cfs_spinlock_t sai_generation_lock = CFS_SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sai_generation_lock); static inline int ll_sa_entry_unlinked(struct ll_sa_entry *entry) { @@ -139,10 +138,10 @@ ll_sa_entry_unhash(struct ll_statahead_info *sai, struct ll_sa_entry *entry) static inline int agl_should_run(struct ll_statahead_info *sai, struct inode *inode) { - if (inode != NULL && S_ISREG(inode->i_mode) && - ll_i2info(inode)->lli_smd != NULL && sai->sai_agl_valid) - return 1; - return 0; + if (inode != NULL && S_ISREG(inode->i_mode) && + ll_i2info(inode)->lli_has_smd && sai->sai_agl_valid) + return 1; + return 0; } static inline struct ll_sa_entry * @@ -1118,9 +1117,8 @@ static int ll_statahead_thread(void *arg) cfs_spin_unlock(&plli->lli_sa_lock); cfs_waitq_signal(&thread->t_ctl_waitq); - plli->lli_sa_pos = 0; ll_dir_chain_init(&chain); - page = ll_get_dir_page(NULL, dir, pos, &chain); + page = ll_get_dir_page(dir, pos, &chain); while (1) { struct lu_dirpage *dp; @@ -1277,9 +1275,8 @@ do_it: */ ll_release_page(page, le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE); - plli->lli_sa_pos = pos; sai->sai_in_readpage = 1; - page = ll_get_dir_page(NULL, dir, pos, &chain); + page = ll_get_dir_page(dir, pos, &chain); sai->sai_in_readpage = 0; } else { LASSERT(le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE); @@ -1395,7 +1392,6 @@ enum { static int is_first_dirent(struct inode *dir, struct dentry *dentry) { - struct ll_inode_info *lli = ll_i2info(dir); struct ll_dir_chain chain; struct qstr *target = &dentry->d_name; struct page *page; @@ -1404,9 +1400,8 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) int rc = LS_NONE_FIRST_DE; ENTRY; - lli->lli_sa_pos = 0; ll_dir_chain_init(&chain); - page = ll_get_dir_page(NULL, dir, pos, &chain); + page = ll_get_dir_page(dir, pos, &chain); while (1) { struct lu_dirpage *dp; @@ -1493,8 +1488,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) */ ll_release_page(page, le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE); - lli->lli_sa_pos = pos; - page = ll_get_dir_page(NULL, dir, pos, &chain); + page = ll_get_dir_page(dir, pos, &chain); } else { /* * go into overflow page.