struct inode *inode = filp->f_dentry->d_inode;
struct ll_file_data *lfd = LUSTRE_FPRIVATE(filp);
struct ll_sb_info *sbi = ll_i2sbi(inode);
- __u64 pos = lfd->lfd_pos;
+ __u64 pos;
int hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
int api32 = ll_need_32bit_api(sbi);
int rc;
#endif
ENTRY;
+ if (lfd != NULL)
+ pos = lfd->lfd_pos;
+ else
+ pos = 0;
+
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %lu/%llu "
" 32bit_api %d\n", inode->i_ino, inode->i_generation,
inode, (unsigned long)pos, i_size_read(inode), api32);
GOTO(out, rc = 0);
rc = ll_dir_read(inode, &pos, cookie, filldir);
- lfd->lfd_pos = pos;
+ if (lfd != NULL)
+ lfd->lfd_pos = pos;
if (pos == MDS_DIR_END_OFF) {
if (api32)
filp->f_pos = LL_DIR_END_OFF_32BIT;
* on 2.4, we use OBD_CONNECT_LVB_TYPE to detect whether the
* server will support REINT_RMENTRY XXX*/
if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
- return -ENOTSUPP;
+ RETURN(-ENOTSUPP);
filename = ll_getname((const char *)arg);
if (IS_ERR(filename))