Add struct md_op_data as a parameter to ll_dir_read.
Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        return type;
 }
 
-int ll_dir_read(struct inode *inode, struct dir_context *ctx)
+int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+               struct dir_context *ctx)
 {
        struct ll_inode_info *info       = ll_i2info(inode);
        struct ll_sb_info    *sbi       = ll_i2sbi(inode);
        __u64 pos = lfd ? lfd->lfd_pos : 0;
        int                     hash64  = sbi->ll_flags & LL_SBI_64BIT_HASH;
        int                     api32   = ll_need_32bit_api(sbi);
+       struct md_op_data *op_data;
        int                     rc;
 
        CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) pos/size %lu/%llu 32bit_api %d\n",
                goto out;
        }
 
+       op_data = ll_prep_md_op_data(NULL, inode, inode, NULL, 0, 0,
+                                    LUSTRE_OPC_ANY, inode);
+       if (IS_ERR(op_data)) {
+               rc = PTR_ERR(op_data);
+               goto out;
+       }
+
        ctx->pos = pos;
-       rc = ll_dir_read(inode, ctx);
+       rc = ll_dir_read(inode, op_data, ctx);
        if (lfd)
                lfd->lfd_pos = ctx->pos;
        if (ctx->pos == MDS_DIR_END_OFF) {
                if (api32 && hash64)
                        ctx->pos >>= 32;
        }
+       ll_finish_md_op_data(op_data);
        filp->f_version = inode->i_version;
 
 out:
 
 extern const struct inode_operations ll_dir_inode_operations;
 struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
                             struct ll_dir_chain *chain);
-int ll_dir_read(struct inode *inode, struct dir_context *ctx);
+int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+               struct dir_context *ctx);
 
 int ll_get_mdt_idx(struct inode *inode);
 /* llite/namei.c */
 
                .lgd_fid = ll_i2info(d_inode(child))->lli_fid,
                .ctx.actor = ll_nfs_get_name_filldir,
        };
+       struct md_op_data *op_data;
 
        if (!dir || !S_ISDIR(dir->i_mode)) {
                rc = -ENOTDIR;
                goto out;
        }
 
+       op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
+                                    LUSTRE_OPC_ANY, dir);
+       if (IS_ERR(op_data)) {
+               rc = PTR_ERR(op_data);
+               goto out;
+       }
+
        inode_lock(dir);
-       rc = ll_dir_read(dir, &lgd.ctx);
+       rc = ll_dir_read(dir, op_data, &lgd.ctx);
        inode_unlock(dir);
+       ll_finish_md_op_data(op_data);
        if (!rc && !lgd.lgd_found)
                rc = -ENOENT;
 out:
 
        __u64                pos    = 0;
        int                    first  = 0;
        int                    rc     = 0;
+       struct md_op_data *op_data;
        struct ll_dir_chain       chain;
        struct l_wait_info      lwi    = { 0 };
 
        CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n",
               sai, parent);
 
+       op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
+                                    LUSTRE_OPC_ANY, dir);
+       if (IS_ERR(op_data))
+               return PTR_ERR(op_data);
+
        if (sbi->ll_flags & LL_SBI_AGL_ENABLED)
                ll_start_agl(parent, sai);
 
        }
 
 out:
+       ll_finish_md_op_data(op_data);
        if (sai->sai_agl_valid) {
                spin_lock(&plli->lli_agl_lock);
                thread_set_flags(agl_thread, SVC_STOPPING);