goto out_unlock;
}
-static loff_t ll_llseek(struct file *filp, loff_t off, int whence)
-{
- if (off != 0 || whence != 1 /* SEEK_CUR */) {
- /*
- * Except when telldir() is going on, reset readdir to the
- * beginning of hash collision chain.
- */
- struct ll_file_data *fd = LUSTRE_FPRIVATE(filp);
-
- fd->fd_dir.lfd_dup = 0;
- }
- return default_llseek(filp, off, whence);
-}
-
int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
struct ll_inode_info *info = ll_i2info(inode);
- struct ll_file_data *fd = LUSTRE_FPRIVATE(filp);
struct ll_sb_info *sbi = ll_i2sbi(inode);
__u32 pos = filp->f_pos;
struct page *page;
struct ll_dir_chain chain;
- __u32 prevhash;
int rc;
- int dup;
int done;
int shift;
ENTRY;
RETURN(0);
rc = 0;
- dup = 0;
done = 0;
shift = 0;
- prevhash = ~0; /* impossible hash value */
ll_dir_chain_init(&chain);
page = ll_get_dir_page(inode, pos, 0, &chain);
* Skip dummy record.
*/
continue;
- /*
- * Keep track of how far we get into duplicate
- * hash segment.
- */
- if (hash == prevhash)
- dup++;
- else
- dup = 0;
- prevhash = hash;
-
- if (hash == fd->fd_dir.lfd_duppos &&
- fd->fd_dir.lfd_dup > 0) {
- fd->fd_dir.lfd_dup--;
- continue;
- }
fid = ent->lde_fid;
name = ent->lde_name;
filp->f_pos = pos;
filp->f_version = inode->i_version;
- fd->fd_dir.lfd_dup = dup;
- fd->fd_dir.lfd_duppos = prevhash;
touch_atime(filp->f_vfsmnt, filp->f_dentry);
ll_dir_chain_fini(&chain);
.release = ll_dir_release,
.read = generic_read_dir,
.readdir = ll_readdir,
- .llseek = ll_llseek,
.ioctl = ll_dir_ioctl
};
struct list_head lli_pending_write_llaps;
struct list_head lli_close_list;
/* handle is to be sent to MDS later on done_writing and setattr.
- * Open handle data are needed for the recovery to reconstruct
+ * Open handle data are needed for the recovery to reconstruct
* the inode state on the MDS. XXX: recovery is not ready yet. */
struct obd_client_handle *lli_pending_och;
-
+
atomic_t lli_mmap_cnt;
/* for writepage() only to communicate to fsync */
};
struct ll_file_dir {
- int lfd_dup;
- loff_t lfd_duppos;
};
extern kmem_cache_t *ll_file_data_slab;