#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
-#include <linux/smp_lock.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
};
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)
{
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 *
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;
*/
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);
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;
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;
*/
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.