Whamcloud - gitweb
- all md_op_data field have prefix op_;
authoryury <yury>
Mon, 6 Nov 2006 16:24:03 +0000 (16:24 +0000)
committeryury <yury>
Mon, 6 Nov 2006 16:24:03 +0000 (16:24 +0000)
- use name[0] == 0 to check if this is partial operation.

27 files changed:
lustre/cmm/cmm_object.c
lustre/cmm/mdc_internal.h
lustre/cmm/mdc_object.c
lustre/include/lustre/lustre_idl.h
lustre/liblustre/file.c
lustre/liblustre/namei.c
lustre/liblustre/super.c
lustre/llite/dcache.c
lustre/llite/file.c
lustre/llite/llite_close.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/mdd/mdd_lov.c
lustre/mdd/mdd_lproc.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_reint.c
lustre/obdclass/obdo.c
lustre/osc/osc_create.c
lustre/ptlrpc/gss/gss_mech_switch.c

index 88aded5..4f1bbc0 100644 (file)
@@ -75,8 +75,8 @@ struct lu_object *cmm_object_alloc(const struct lu_env *env,
                                    const struct lu_object_header *loh,
                                    struct lu_device *ld)
 {
-        struct lu_object  *lo = NULL;
         const struct lu_fid *fid = &loh->loh_fid;
+        struct lu_object  *lo = NULL;
         struct cmm_device *cd;
         mdsno_t mdsnum;
         int rc = 0;
index eb846f9..b5a2ae6 100644 (file)
@@ -57,7 +57,7 @@ struct mdc_device {
 
 struct mdc_thread_info {
         struct md_op_data       mci_opdata;
-        struct ptlrpc_request   *mci_req;
+        struct ptlrpc_request  *mci_req;
 };
 
 struct mdc_object {
index 5168e0b..53aeabc 100644 (file)
@@ -105,12 +105,8 @@ struct mdc_thread_info *mdc_info_get(const struct lu_env *env)
 static
 struct mdc_thread_info *mdc_info_init(const struct lu_env *env)
 {
-        struct mdc_thread_info *mci;
-
-        mci = mdc_info_get(env);
-
+        struct mdc_thread_info *mci = mdc_info_get(env);
         memset(mci, 0, sizeof(*mci));
-
         return mci;
 }
 
@@ -216,10 +212,9 @@ static int mdc_attr_get(const struct lu_env *env, struct md_object *mo,
 
         memset(&mci->mci_opdata, 0, sizeof(mci->mci_opdata));
 
-        rc = md_getattr(mc->mc_desc.cl_exp, lu_object_fid(&mo->mo_lu), NULL,
-                        OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID |
-                        OBD_MD_FLFLAGS,
-                        0, &mci->mci_req);
+        rc = md_getattr(mc->mc_desc.cl_exp, lu_object_fid(&mo->mo_lu),
+                        NULL, OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID |
+                        OBD_MD_FLFLAGS, 0, &mci->mci_req);
         if (rc == 0) {
                 /* get attr from request */
                 rc = mdc_req2attr_update(env, ma);
@@ -249,12 +244,13 @@ static int mdc_object_create(const struct lu_env *env,
 
         LASSERT(S_ISDIR(la->la_mode));
         LASSERT(spec->u.sp_pfid != NULL);
+
         mci = mdc_info_init(env);
-        mci->mci_opdata.fid2 = *lu_object_fid(&mo->mo_lu);
+        mci->mci_opdata.op_fid2 = *lu_object_fid(&mo->mo_lu);
         
         /* Parent fid is needed to create dotdot on the remote node. */
-        mci->mci_opdata.fid1 = *(spec->u.sp_pfid);
-        mci->mci_opdata.mod_time = la->la_mtime;
+        mci->mci_opdata.op_fid1 = *(spec->u.sp_pfid);
+        mci->mci_opdata.op_mod_time = la->la_mtime;
         if (uc &&
             ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))) {
                 uid = uc->mu_fsuid;
@@ -264,27 +260,27 @@ static int mdc_object_create(const struct lu_env *env,
                         gid = uc->mu_fsgid;
                 cap = uc->mu_cap;
                 if (uc->mu_ginfo || (uc->mu_valid == UCRED_OLD))
-                        mci->mci_opdata.suppgids[0] = uc->mu_suppgids[0];
+                        mci->mci_opdata.op_suppgids[0] = uc->mu_suppgids[0];
                 else
-                        mci->mci_opdata.suppgids[0] = -1;
+                        mci->mci_opdata.op_suppgids[0] = -1;
         } else {
                 uid = la->la_uid;
                 gid = la->la_gid;
                 cap = 0;
-                mci->mci_opdata.suppgids[0] = -1;
+                mci->mci_opdata.op_suppgids[0] = -1;
         }
 
         /* get data from spec */
         if (spec->sp_cr_flags & MDS_CREATE_SLAVE_OBJ) {
                 symname = spec->u.sp_ea.eadata;
                 symlen = spec->u.sp_ea.eadatalen;
-                mci->mci_opdata.fid1 = *(spec->u.sp_ea.fid);
-                mci->mci_opdata.flags |= MDS_CREATE_SLAVE_OBJ;
+                mci->mci_opdata.op_fid1 = *(spec->u.sp_ea.fid);
+                mci->mci_opdata.op_flags |= MDS_CREATE_SLAVE_OBJ;
 #ifdef CONFIG_FS_POSIX_ACL
         } else if (spec->sp_cr_flags & MDS_CREATE_RMT_ACL) {
                 symname = spec->u.sp_ea.eadata;
                 symlen = spec->u.sp_ea.eadatalen;
-                mci->mci_opdata.flags |= MDS_CREATE_RMT_ACL;
+                mci->mci_opdata.op_flags |= MDS_CREATE_RMT_ACL;
 #endif
         } else {
                 symname = spec->u.sp_symname;
@@ -292,9 +288,8 @@ static int mdc_object_create(const struct lu_env *env,
         }
 
         rc = md_create(mc->mc_desc.cl_exp, &mci->mci_opdata,
-                       symname, symlen,
-                       la->la_mode, uid, gid, cap, la->la_rdev,
-                       &mci->mci_req);
+                       symname, symlen, la->la_mode, uid, gid,
+                       cap, la->la_rdev, &mci->mci_req);
 
         if (rc == 0) {
                 /* get attr from request */
@@ -318,28 +313,28 @@ static int mdc_ref_add(const struct lu_env *env, struct md_object *mo)
         LASSERT(mci);
 
         memset(&mci->mci_opdata, 0, sizeof(mci->mci_opdata));
-        mci->mci_opdata.fid1 = *lu_object_fid(&mo->mo_lu);
-        //mci->mci_opdata.mod_time = la->la_ctime;
-        //mci->mci_opdata.fsuid = la->la_uid;
-        //mci->mci_opdata.fsgid = la->la_gid;
-        mci->mci_opdata.mod_time = CURRENT_SECONDS;
+        mci->mci_opdata.op_fid1 = *lu_object_fid(&mo->mo_lu);
+        //mci->mci_opdata.op_mod_time = la->la_ctime;
+        //mci->mci_opdata.op_fsuid = la->la_uid;
+        //mci->mci_opdata.op_fsgid = la->la_gid;
+        mci->mci_opdata.op_mod_time = CURRENT_SECONDS;
         if (uc &&
             ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))) {
-                mci->mci_opdata.fsuid = uc->mu_fsuid;
-                mci->mci_opdata.fsgid = uc->mu_fsgid;
-                mci->mci_opdata.cap = uc->mu_cap;
+                mci->mci_opdata.op_fsuid = uc->mu_fsuid;
+                mci->mci_opdata.op_fsgid = uc->mu_fsgid;
+                mci->mci_opdata.op_cap = uc->mu_cap;
                 if (uc->mu_ginfo || (uc->mu_valid == UCRED_OLD)) {
-                        mci->mci_opdata.suppgids[0] = uc->mu_suppgids[0];
-                        mci->mci_opdata.suppgids[1] = uc->mu_suppgids[1];
+                        mci->mci_opdata.op_suppgids[0] = uc->mu_suppgids[0];
+                        mci->mci_opdata.op_suppgids[1] = uc->mu_suppgids[1];
                 } else {
-                        mci->mci_opdata.suppgids[0] =
-                                mci->mci_opdata.suppgids[1] = -1;
+                        mci->mci_opdata.op_suppgids[0] =
+                                mci->mci_opdata.op_suppgids[1] = -1;
                 }
         } else {
-                mci->mci_opdata.fsuid = current->fsuid;
-                mci->mci_opdata.fsgid = current->fsgid;
-                mci->mci_opdata.cap = current->cap_effective;
-                mci->mci_opdata.suppgids[0] = mci->mci_opdata.suppgids[1] = -1;
+                mci->mci_opdata.op_fsuid = current->fsuid;
+                mci->mci_opdata.op_fsgid = current->fsgid;
+                mci->mci_opdata.op_cap = current->cap_effective;
+                mci->mci_opdata.op_suppgids[0] = mci->mci_opdata.op_suppgids[1] = -1;
         }
 
 
@@ -361,23 +356,23 @@ static int mdc_ref_del(const struct lu_env *env, struct md_object *mo,
         ENTRY;
 
         mci = mdc_info_init(env);
-        mci->mci_opdata.fid1 = *lu_object_fid(&mo->mo_lu);
-        mci->mci_opdata.mode = la->la_mode;
-        mci->mci_opdata.mod_time = la->la_ctime;
+        mci->mci_opdata.op_fid1 = *lu_object_fid(&mo->mo_lu);
+        mci->mci_opdata.op_mode = la->la_mode;
+        mci->mci_opdata.op_mod_time = la->la_ctime;
         if (uc &&
             ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))) {
-                mci->mci_opdata.fsuid = uc->mu_fsuid;
-                mci->mci_opdata.fsgid = uc->mu_fsgid;
-                mci->mci_opdata.cap = uc->mu_cap;
+                mci->mci_opdata.op_fsuid = uc->mu_fsuid;
+                mci->mci_opdata.op_fsgid = uc->mu_fsgid;
+                mci->mci_opdata.op_cap = uc->mu_cap;
                 if (uc->mu_ginfo || (uc->mu_valid == UCRED_OLD))
-                        mci->mci_opdata.suppgids[0] = uc->mu_suppgids[0];
+                        mci->mci_opdata.op_suppgids[0] = uc->mu_suppgids[0];
                 else
-                        mci->mci_opdata.suppgids[0] = -1;
+                        mci->mci_opdata.op_suppgids[0] = -1;
         } else {
-                mci->mci_opdata.fsuid = la->la_uid;
-                mci->mci_opdata.fsgid = la->la_gid;
-                mci->mci_opdata.cap = current->cap_effective;
-                mci->mci_opdata.suppgids[0] = -1;
+                mci->mci_opdata.op_fsuid = la->la_uid;
+                mci->mci_opdata.op_fsgid = la->la_gid;
+                mci->mci_opdata.op_cap = current->cap_effective;
+                mci->mci_opdata.op_suppgids[0] = -1;
         }
 
         rc = md_unlink(mc->mc_desc.cl_exp, &mci->mci_opdata, &mci->mci_req);
@@ -427,27 +422,27 @@ static int mdc_rename_tgt(const struct lu_env *env, struct md_object *mo_p,
         ENTRY;
 
         mci = mdc_info_init(env);
-        mci->mci_opdata.fid1 = *lu_object_fid(&mo_p->mo_lu);
-        mci->mci_opdata.fid2 = *lf;
-        mci->mci_opdata.mode = la->la_mode;
-        mci->mci_opdata.mod_time = la->la_ctime;
+        mci->mci_opdata.op_fid1 = *lu_object_fid(&mo_p->mo_lu);
+        mci->mci_opdata.op_fid2 = *lf;
+        mci->mci_opdata.op_mode = la->la_mode;
+        mci->mci_opdata.op_mod_time = la->la_ctime;
         if (uc &&
             ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))) {
-                mci->mci_opdata.fsuid = uc->mu_fsuid;
-                mci->mci_opdata.fsgid = uc->mu_fsgid;
-                mci->mci_opdata.cap = uc->mu_cap;
+                mci->mci_opdata.op_fsuid = uc->mu_fsuid;
+                mci->mci_opdata.op_fsgid = uc->mu_fsgid;
+                mci->mci_opdata.op_cap = uc->mu_cap;
                 if (uc->mu_ginfo || (uc->mu_valid == UCRED_OLD)) {
-                        mci->mci_opdata.suppgids[0] = uc->mu_suppgids[0];
-                        mci->mci_opdata.suppgids[1] = uc->mu_suppgids[1];
+                        mci->mci_opdata.op_suppgids[0] = uc->mu_suppgids[0];
+                        mci->mci_opdata.op_suppgids[1] = uc->mu_suppgids[1];
                 } else {
-                        mci->mci_opdata.suppgids[0] =
-                                mci->mci_opdata.suppgids[1] = -1;
+                        mci->mci_opdata.op_suppgids[0] =
+                                mci->mci_opdata.op_suppgids[1] = -1;
                 }
         } else {
-                mci->mci_opdata.fsuid = la->la_uid;
-                mci->mci_opdata.fsgid = la->la_gid;
-                mci->mci_opdata.cap = current->cap_effective;
-                mci->mci_opdata.suppgids[0] = mci->mci_opdata.suppgids[1] = -1;
+                mci->mci_opdata.op_fsuid = la->la_uid;
+                mci->mci_opdata.op_fsgid = la->la_gid;
+                mci->mci_opdata.op_cap = current->cap_effective;
+                mci->mci_opdata.op_suppgids[0] = mci->mci_opdata.op_suppgids[1] = -1;
         }
 
         rc = md_rename(mc->mc_desc.cl_exp, &mci->mci_opdata, NULL, 0,
index bee576b..0feec4d 100644 (file)
@@ -584,15 +584,17 @@ typedef uint32_t        obd_count;
 #define OBD_FL_CREATE_CROW   (0x00000400) /* object should be create on write */
 
 /*
- * set this to delegate DLM locking during obd_punch() to the OSTs. Only OSTs
+ * Set this to delegate DLM locking during obd_punch() to the OSTs. Only OSTs
  * that declared OBD_CONNECT_TRUNCLOCK in their connect flags support this
  * functionality.
  */
 #define OBD_FL_TRUNCLOCK     (0x00000800)
 
-/* this should be not smaller than sizeof(struct lustre_handle) + sizeof(struct
- * llog_cookie) + sizeof(ll_fid). Nevertheless struct ll_fid is not longer
- * stored in o_inline, we keep this just for case. */
+/*
+ * This should not be smaller than sizeof(struct lustre_handle) + sizeof(struct
+ * llog_cookie) + sizeof(struct ll_fid). Nevertheless struct ll_fid is not
+ * longer stored in o_inline, we keep this just for case.
+ */
 #define OBD_INLINESZ    80
 
 /* Note: 64-bit types are 64-bit aligned in structure */
@@ -633,35 +635,36 @@ struct obdo {
 extern void lustre_swab_obdo (struct obdo *o);
 
 struct md_op_data {
-        struct lu_fid         fid1;
-        struct lu_fid         fid2;
-        struct lustre_handle  handle;
-        __u64                 mod_time;
-        const char           *name;
-        int                   namelen;
-        __u32                 mode;
-        struct lmv_stripe_md *mea1;
-        struct lmv_stripe_md *mea2;
-        __u32                 suppgids[2];
-        __u32                 fsuid;
-        __u32                 fsgid;
-        __u32                 cap;
+        struct lu_fid           op_fid1;
+        struct lu_fid           op_fid2;
+        struct lustre_handle    op_handle;
+        __u64                   op_mod_time;
+        const char             *op_name;
+        int                     op_namelen;
+        __u32                   op_mode;
+        struct lmv_stripe_md   *op_mea1;
+        struct lmv_stripe_md   *op_mea2;
+        __u32                   op_suppgids[2];
+        __u32                   op_fsuid;
+        __u32                   op_fsgid;
+        __u32                   op_cap;
 
         /* iattr fields and blocks. */
-        struct iattr          attr;
+        struct iattr            op_attr;
 #ifdef __KERNEL__
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
-        unsigned int          attr_flags;
+        unsigned int            op_attr_flags;
 #endif
 #endif
-        loff_t                attr_blocks;
+        loff_t                  op_attr_blocks;
 
         /* Size-on-MDS epoch and flags. */
-        __u64                 ioepoch;
-        __u32                 flags;
+        __u64                   op_ioepoch;
+        __u32                   op_flags;
 
-        struct obd_capa      *mod_capa1;
-        struct obd_capa      *mod_capa2;
+        /* Capa fields */
+        struct obd_capa        *op_mod_capa1;
+        struct obd_capa        *op_mod_capa2;
 };
 
 #define MDS_MODE_DONT_LOCK (1 << 30)
index 7055784..aa9c17b 100644 (file)
@@ -80,20 +80,20 @@ void llu_prep_md_op_data(struct md_op_data *op_data, struct inode *i1,
         memset(op_data, 0, sizeof(*op_data));
 
         if (i1) {
-                ll_i2gids(op_data->suppgids, i1, i2);
-                op_data->fid1 = *ll_inode2fid(i1);
+                ll_i2gids(op_data->op_suppgids, i1, i2);
+                op_data->op_fid1 = *ll_inode2fid(i1);
         }else {
-                ll_i2gids(op_data->suppgids, i2, i1);
-                op_data->fid1 = *ll_inode2fid(i2);
+                ll_i2gids(op_data->op_suppgids, i2, i1);
+                op_data->op_fid1 = *ll_inode2fid(i2);
         }
 
         if (i2)
-                op_data->fid2 = *ll_inode2fid(i2);
+                op_data->op_fid2 = *ll_inode2fid(i2);
 
-        op_data->name = name;
-        op_data->namelen = namelen;
-        op_data->mode = mode;
-        op_data->mod_time = CURRENT_TIME;
+        op_data->op_name = name;
+        op_data->op_namelen = namelen;
+        op_data->op_mode = mode;
+        op_data->op_mod_time = CURRENT_TIME;
 }
 
 void llu_finish_md_op_data(struct md_op_data *op_data)
@@ -333,8 +333,8 @@ int llu_sizeonmds_update(struct inode *inode, struct lustre_handle *fh)
         }
         
         md_from_obdo(&op_data, &oa, oa.o_valid);
-        memcpy(&op_data.handle, fh, sizeof(*fh));
-        op_data.flags |= MF_SOM_CHANGE;
+        memcpy(&op_data.op_handle, fh, sizeof(*fh));
+        op_data.op_flags |= MF_SOM_CHANGE;
 
         rc = llu_md_setattr(inode, &op_data);
         RETURN(rc);
@@ -359,36 +359,36 @@ int llu_md_close(struct obd_export *md_exp, struct inode *inode)
                                        &fd->fd_cwlockh);
         }
 
-        op_data.attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET |
+        op_data.op_attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET |
                                 ATTR_MTIME_SET | ATTR_CTIME_SET;
         
         if (fd->fd_flags & FMODE_WRITE) {
                 if (!S_ISREG(llu_i2stat(inode)->st_mode)) {
-                        op_data.attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS;
+                        op_data.op_attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS;
                 } else {
                         /* Inode cannot be dirty. Close the epoch. */
-                        op_data.flags |= MF_EPOCH_CLOSE;
+                        op_data.op_flags |= MF_EPOCH_CLOSE;
                         /* XXX: Send CHANGE flag only if Size-on-MDS inode attributes
                          * are really changed.  */
-                        op_data.flags |= MF_SOM_CHANGE;
+                        op_data.op_flags |= MF_SOM_CHANGE;
 
                         /* Pack Size-on-MDS attributes if we are in IO epoch and 
                          * attributes are valid. */
                         LASSERT(!(lli->lli_flags & LLIF_MDS_SIZE_LOCK));
                         if (!llu_local_size(inode))
-                                op_data.attr.ia_valid |= 
+                                op_data.op_attr.ia_valid |= 
                                         OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
                 }
         }
-        op_data.fid1 = lli->lli_fid;
-        op_data.attr.ia_atime = st->st_atime;
-        op_data.attr.ia_mtime = st->st_mtime;
-        op_data.attr.ia_ctime = st->st_ctime;
-        op_data.attr.ia_size = st->st_size;
-        op_data.attr_blocks = st->st_blocks;
-        op_data.attr.ia_attr_flags = lli->lli_st_flags;
-        op_data.ioepoch = lli->lli_ioepoch;
-        memcpy(&op_data.handle, &och->och_fh, sizeof(op_data.handle));
+        op_data.op_fid1 = lli->lli_fid;
+        op_data.op_attr.ia_atime = st->st_atime;
+        op_data.op_attr.ia_mtime = st->st_mtime;
+        op_data.op_attr.ia_ctime = st->st_ctime;
+        op_data.op_attr.ia_size = st->st_size;
+        op_data.op_attr_blocks = st->st_blocks;
+        op_data.op_attr.ia_attr_flags = lli->lli_st_flags;
+        op_data.op_ioepoch = lli->lli_ioepoch;
+        memcpy(&op_data.op_handle, &och->och_fh, sizeof(op_data.op_handle));
 
         rc = md_close(md_exp, &op_data, och, &req);
         if (rc == -EAGAIN) {
index 7cdaf1f..979d295 100644 (file)
@@ -455,7 +455,7 @@ static int llu_lookup_it(struct inode *parent, struct pnode *pnode,
                                                   .ph_cname = &pnode->p_base->pb_name,
                                                   .ph_opc = LUSTRE_OPC_CREATE };
                 
-                rc = llu_fid_md_alloc(llu_i2sbi(parent), &op_data.fid2, &hint);
+                rc = llu_fid_md_alloc(llu_i2sbi(parent), &op_data.op_fid2, &hint);
                 if (rc) {
                         CERROR("can't allocate new fid, rc %d\n", rc);
                         LBUG();
index 2c41d10..32962d1 100644 (file)
@@ -646,7 +646,7 @@ int llu_md_setattr(struct inode *inode, struct md_op_data *op_data)
          * above to avoid invoking vmtruncate, otherwise it is important
          * to call vmtruncate in inode_setattr to update inode->i_size
          * (bug 6196) */
-        inode_setattr(inode, &op_data->attr);
+        inode_setattr(inode, &op_data->op_attr);
         llu_update_inode(inode, md.body, md.lsm);
         ptlrpc_req_finished(request);
 
@@ -668,14 +668,14 @@ static int llu_setattr_done_writing(struct inode *inode,
 
         /* XXX: pass och here for the recovery purpose. */
         CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
-               op_data->ioepoch, PFID(&lli->lli_fid));
+               op_data->op_ioepoch, PFID(&lli->lli_fid));
 
-        op_data->flags = MF_EPOCH_CLOSE | MF_SOM_CHANGE;
+        op_data->op_flags = MF_EPOCH_CLOSE | MF_SOM_CHANGE;
         rc = md_done_writing(llu_i2sbi(inode)->ll_md_exp, op_data, NULL);
         if (rc == -EAGAIN) {
                 /* MDS has instructed us to obtain Size-on-MDS attribute
                  * from OSTs and send setattr to back to MDS. */
-                rc = llu_sizeonmds_update(inode, &op_data->handle);
+                rc = llu_sizeonmds_update(inode, &op_data->op_handle);
         } else if (rc) {
                 CERROR("inode %llu mdc truncate failed: rc = %d\n",
                        st->st_ino, rc);
@@ -757,18 +757,18 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
          * In that case, we need to check permissions and update the local
          * inode ourselves so we can call obdo_from_inode() always. */
         if (ia_valid & (lsm ? ~(ATTR_FROM_OPEN | ATTR_RAW) : ~0)) {
-                memcpy(&op_data.attr, attr, sizeof(*attr));
+                memcpy(&op_data.op_attr, attr, sizeof(*attr));
 
                 /* Open epoch for truncate. */
                 if (ia_valid & ATTR_SIZE)
-                        op_data.flags = MF_EPOCH_OPEN;
+                        op_data.op_flags = MF_EPOCH_OPEN;
                 rc = llu_md_setattr(inode, &op_data);
                 if (rc)
                         RETURN(rc);
 
                 if (!lsm || !S_ISREG(st->st_mode)) {
                         CDEBUG(D_INODE, "no lsm: not setting attrs on OST\n");
-                        if (op_data.ioepoch)
+                        if (op_data.op_ioepoch)
                                 rc = llu_setattr_done_writing(inode, &op_data);
                         RETURN(rc);
                 }
@@ -846,7 +846,7 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
                                 rc = err;
                 }
 
-                if (op_data.ioepoch)
+                if (op_data.op_ioepoch)
                         rc = llu_setattr_done_writing(inode, &op_data);
         } else if (ia_valid & (ATTR_MTIME | ATTR_MTIME_SET)) {
                 struct obd_info oinfo = { { { 0 } } };
@@ -948,7 +948,7 @@ static int llu_iop_symlink_raw(struct pnode *pno, const char *tgt)
         llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0);
 
         /* allocate new fid */
-        err = llu_fid_md_alloc(sbi, &op_data.fid2, &hint);
+        err = llu_fid_md_alloc(sbi, &op_data.op_fid2, &hint);
         if (err) {
                 CERROR("can't allocate new fid, rc %d\n", err);
                 RETURN(err);
@@ -1086,7 +1086,7 @@ static int llu_iop_mknod_raw(struct pnode *pno,
                                     pno->p_base->pb_name.name,
                                     pno->p_base->pb_name.len, 0);
                 /* allocate new fid */
-                err = llu_fid_md_alloc(sbi, &op_data.fid2, &hint);
+                err = llu_fid_md_alloc(sbi, &op_data.op_fid2, &hint);
                 if (err) {
                         CERROR("can't allocate new fid, rc %d\n", err);
                         RETURN(err);
@@ -1330,7 +1330,7 @@ static int llu_iop_mkdir_raw(struct pnode *pno, mode_t mode)
         llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0);
 
         /* allocate new fid */
-        err = llu_fid_md_alloc(llu_i2sbi(dir), &op_data.fid2, &hint);
+        err = llu_fid_md_alloc(llu_i2sbi(dir), &op_data.op_fid2, &hint);
         if (err) {
                 CERROR("can't allocate new fid, rc %d\n", err);
                 RETURN(err);
index 5d09d1b..0fcb61d 100644 (file)
@@ -414,7 +414,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                                             de->d_name.name, de->d_name.len, 0);
                 if (op_data == NULL)
                         RETURN(-ENOMEM);
-                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->fid2, &hint);
+                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->op_fid2, &hint);
                 if (rc) {
                         ll_finish_md_op_data(op_data);
                         RETURN(rc);
@@ -590,7 +590,7 @@ do_lookup:
                                                   .ph_cname = &de->d_name,
                                                   .ph_opc = LUSTRE_OPC_CREATE };
 
-                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->fid2, &hint);
+                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->op_fid2, &hint);
                 if (rc) {
                         ll_finish_md_op_data(op_data);
                         RETURN(rc);
@@ -604,7 +604,7 @@ do_lookup:
                                                            DLM_REPLY_REC_OFF,
                                                            sizeof(*mdt_body));
                 /* see if we got same inode, if not - return error */
-                if (lu_fid_eq(&op_data->fid2, &mdt_body->fid1)) {
+                if (lu_fid_eq(&op_data->op_fid2, &mdt_body->fid1)) {
                         ll_finish_md_op_data(op_data);
                         op_data = NULL;
                         goto revalidate_finish;
index eed25df..7ea392d 100644 (file)
@@ -51,17 +51,17 @@ static void ll_file_data_put(struct ll_file_data *fd)
 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
                           struct lustre_handle *fh)
 {
-        op_data->fid1 = ll_i2info(inode)->lli_fid;
-        op_data->attr.ia_mode = inode->i_mode;
-        op_data->attr.ia_atime = inode->i_atime;
-        op_data->attr.ia_mtime = inode->i_mtime;
-        op_data->attr.ia_ctime = inode->i_ctime;
-        op_data->attr.ia_size = inode->i_size;
-        op_data->attr_blocks = inode->i_blocks;
-        ((struct ll_iattr *)&op_data->attr)->ia_attr_flags = inode->i_flags;
-        op_data->ioepoch = ll_i2info(inode)->lli_ioepoch;
-        memcpy(&op_data->handle, fh, sizeof(op_data->handle));
-        op_data->mod_capa1 = ll_mdscapa_get(inode);
+        op_data->op_fid1 = ll_i2info(inode)->lli_fid;
+        op_data->op_attr.ia_mode = inode->i_mode;
+        op_data->op_attr.ia_atime = inode->i_atime;
+        op_data->op_attr.ia_mtime = inode->i_mtime;
+        op_data->op_attr.ia_ctime = inode->i_ctime;
+        op_data->op_attr.ia_size = inode->i_size;
+        op_data->op_attr_blocks = inode->i_blocks;
+        ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags = inode->i_flags;
+        op_data->op_ioepoch = ll_i2info(inode)->lli_ioepoch;
+        memcpy(&op_data->op_handle, fh, sizeof(op_data->op_handle));
+        op_data->op_mod_capa1 = ll_mdscapa_get(inode);
 }
 
 static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
@@ -69,14 +69,14 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
 {
         ENTRY;
 
-        op_data->attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET |
+        op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME_SET |
                                  ATTR_MTIME_SET | ATTR_CTIME_SET;
 
         if (!(och->och_flags & FMODE_WRITE))
                 goto out;
 
         if (!S_ISREG(inode->i_mode))
-                op_data->attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS;
+                op_data->op_attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS;
         else
                 ll_epoch_close(inode, op_data, &och, 0);
 
@@ -121,7 +121,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp,
 
         ll_prepare_close(inode, op_data, och);
         epoch_close = (och->och_flags & FMODE_WRITE) &&
-                      ((op_data->flags & MF_EPOCH_CLOSE) ||
+                      ((op_data->op_flags & MF_EPOCH_CLOSE) ||
                        !S_ISREG(inode->i_mode));
         rc = md_close(md_exp, op_data, och, &req);
 
index 9c74070..5200e09 100644 (file)
@@ -123,8 +123,8 @@ void ll_epoch_close(struct inode *inode, struct md_op_data *op_data,
         }
 
         CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID"\n",
-               op_data->ioepoch, PFID(&lli->lli_fid));
-        op_data->flags |= MF_EPOCH_CLOSE;
+               op_data->op_ioepoch, PFID(&lli->lli_fid));
+        op_data->op_flags |= MF_EPOCH_CLOSE;
 
         if (flags & LLIF_DONE_WRITING) {
                 LASSERT(lli->lli_flags & LLIF_SOM_DIRTY);
@@ -148,13 +148,13 @@ void ll_epoch_close(struct inode *inode, struct md_op_data *op_data,
         }
         
         spin_unlock(&lli->lli_lock);
-        op_data->flags |= MF_SOM_CHANGE;
+        op_data->op_flags |= MF_SOM_CHANGE;
 
         /* Check if Size-on-MDS attributes are valid. */
         LASSERT(!(lli->lli_flags & LLIF_MDS_SIZE_LOCK));
         if (!ll_local_size(inode)) {
                 /* Send Size-on-MDS Attributes if valid. */
-                op_data->attr.ia_valid |= ATTR_MTIME_SET | ATTR_CTIME_SET |
+                op_data->op_attr.ia_valid |= ATTR_MTIME_SET | ATTR_CTIME_SET |
                                           ATTR_SIZE | ATTR_BLOCKS;
         }
         EXIT;
@@ -188,10 +188,10 @@ int ll_sizeonmds_update(struct inode *inode, struct lustre_handle *fh)
         CDEBUG(D_INODE, "Size-on-MDS update on "DFID"\n", PFID(&lli->lli_fid));
         
         md_from_obdo(op_data, oa, oa->o_valid);
-        memcpy(&op_data->handle, fh, sizeof(*fh));
+        memcpy(&op_data->op_handle, fh, sizeof(*fh));
         
-        op_data->ioepoch = lli->lli_ioepoch;
-        op_data->flags |= MF_SOM_CHANGE;
+        op_data->op_ioepoch = lli->lli_ioepoch;
+        op_data->op_flags |= MF_SOM_CHANGE;
         
         rc = ll_md_setattr(inode, op_data);
         EXIT;
index 28fc587..195cd7f 100644 (file)
@@ -1264,7 +1264,7 @@ int ll_md_setattr(struct inode *inode, struct md_op_data *op_data)
                          * Pretend we done everything. */
                         if (!S_ISREG(inode->i_mode) &&
                             !S_ISDIR(inode->i_mode))
-                                rc = inode_setattr(inode, &op_data->attr);
+                                rc = inode_setattr(inode, &op_data->op_attr);
                 } else if (rc != -EPERM && rc != -EACCES) {
                         CERROR("md_setattr fails: rc = %d\n", rc);
                 }
@@ -1283,11 +1283,11 @@ int ll_md_setattr(struct inode *inode, struct md_op_data *op_data)
          * above to avoid invoking vmtruncate, otherwise it is important
          * to call vmtruncate in inode_setattr to update inode->i_size
          * (bug 6196) */
-        rc = inode_setattr(inode, &op_data->attr);
+        rc = inode_setattr(inode, &op_data->op_attr);
 
         /* Extract epoch data if obtained. */
-        memcpy(&op_data->handle, &md.body->handle, sizeof(op_data->handle));
-        op_data->ioepoch = md.body->ioepoch;
+        memcpy(&op_data->op_handle, &md.body->handle, sizeof(op_data->op_handle));
+        op_data->op_ioepoch = md.body->ioepoch;
         
         ll_update_inode(inode, &md);
         ptlrpc_req_finished(request);
@@ -1308,15 +1308,15 @@ static int ll_setattr_done_writing(struct inode *inode,
                 RETURN(0);
 
         CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
-               op_data->ioepoch, PFID(&lli->lli_fid));
+               op_data->op_ioepoch, PFID(&lli->lli_fid));
 
-        op_data->flags = MF_EPOCH_CLOSE | MF_SOM_CHANGE;
+        op_data->op_flags = MF_EPOCH_CLOSE | MF_SOM_CHANGE;
         /* XXX: pass och here for the recovery purpose. */
         rc = md_done_writing(ll_i2sbi(inode)->ll_md_exp, op_data, NULL);
         if (rc == -EAGAIN) {
                 /* MDS has instructed us to obtain Size-on-MDS attribute
                  * from OSTs and send setattr to back to MDS. */
-                rc = ll_sizeonmds_update(inode, &op_data->handle);
+                rc = ll_sizeonmds_update(inode, &op_data->op_handle);
         } else if (rc) {
                 CERROR("inode %lu mdc truncate failed: rc = %d\n",
                        inode->i_ino, rc);
@@ -1409,17 +1409,17 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                 if (op_data == NULL)
                         RETURN(-ENOMEM);
 
-                memcpy(&op_data->attr, attr, sizeof(*attr));
+                memcpy(&op_data->op_attr, attr, sizeof(*attr));
 
                 /* Open epoch for truncate. */
                 if (ia_valid & ATTR_SIZE)
-                        op_data->flags = MF_EPOCH_OPEN;
+                        op_data->op_flags = MF_EPOCH_OPEN;
                 rc = ll_md_setattr(inode, op_data);
                 if (rc)
                         GOTO(out, rc);
 
                 CDEBUG(D_INODE, "Epoch "LPU64" opened on "DFID" for truncate\n",
-                       op_data->ioepoch, PFID(&lli->lli_fid));
+                       op_data->op_ioepoch, PFID(&lli->lli_fid));
 
                 if (!lsm || !S_ISREG(inode->i_mode)) {
                         CDEBUG(D_INODE, "no lsm: not setting attrs on OST\n");
@@ -1533,7 +1533,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
         EXIT;
 out:
         if (op_data) {
-                if (op_data->ioepoch) {
+                if (op_data->op_ioepoch) {
                         rc1 = ll_setattr_done_writing(inode, op_data);
                 }
                 ll_finish_md_op_data(op_data);
@@ -1946,8 +1946,8 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                 if (op_data == NULL)
                         RETURN(-ENOMEM);
                 
-                ((struct ll_iattr *)&op_data->attr)->ia_attr_flags = flags;
-                op_data->attr.ia_valid |= ATTR_ATTR_FLAG;
+                ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags = flags;
+                op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
                 rc = md_setattr(sbi->ll_md_exp, op_data,
                                 NULL, 0, NULL, 0, &req);
                 ll_finish_md_op_data(op_data);
@@ -2244,32 +2244,32 @@ ll_prep_md_op_data(struct md_op_data *op_data, struct inode *i1,
         if (op_data == NULL)
                 return NULL;
 
-        ll_i2gids(op_data->suppgids, i1, i2);
-        op_data->fid1 = *ll_inode2fid(i1);
-        op_data->mod_capa1 = ll_mdscapa_get(i1);
+        ll_i2gids(op_data->op_suppgids, i1, i2);
+        op_data->op_fid1 = *ll_inode2fid(i1);
+        op_data->op_mod_capa1 = ll_mdscapa_get(i1);
 
         /* @i2 may be NULL. In this case caller itself has to initialize ->fid2
          * if needed. */
         if (i2) {
-                op_data->fid2 = *ll_inode2fid(i2);
-                op_data->mod_capa2 = ll_mdscapa_get(i2);
+                op_data->op_fid2 = *ll_inode2fid(i2);
+                op_data->op_mod_capa2 = ll_mdscapa_get(i2);
         }
 
-        op_data->name = name;
-        op_data->namelen = namelen;
-        op_data->mode = mode;
-        op_data->mod_time = CURRENT_SECONDS;
-        op_data->fsuid = current->fsuid;
-        op_data->fsgid = current->fsgid;
-        op_data->cap = current->cap_effective;
+        op_data->op_name = name;
+        op_data->op_namelen = namelen;
+        op_data->op_mode = mode;
+        op_data->op_mod_time = CURRENT_SECONDS;
+        op_data->op_fsuid = current->fsuid;
+        op_data->op_fsgid = current->fsgid;
+        op_data->op_cap = current->cap_effective;
 
         return op_data;
 }
 
 void ll_finish_md_op_data(struct md_op_data *op_data)
 {
-        capa_put(op_data->mod_capa1);
-        capa_put(op_data->mod_capa2);
+        capa_put(op_data->op_mod_capa1);
+        capa_put(op_data->op_mod_capa2);
         OBD_FREE_PTR(op_data);
 }
 
index 57d6422..f755360 100644 (file)
@@ -449,7 +449,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
                                                   .ph_cname = &dentry->d_name,
                                                   .ph_opc = LUSTRE_OPC_CREATE };
 
-                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->fid2, &hint);
+                rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->op_fid2, &hint);
                 if (rc) {
                         ll_finish_md_op_data(op_data);
                         LASSERT(rc < 0);
@@ -752,7 +752,7 @@ static int ll_mknod_generic(struct inode *dir, struct qstr *name, int mode,
                                              name->len, 0);
                 if (op_data == NULL)
                         RETURN(-ENOMEM);
-                err = ll_fid_md_alloc(sbi, &op_data->fid2, &hint);
+                err = ll_fid_md_alloc(sbi, &op_data->op_fid2, &hint);
                 if (err) {
                         ll_finish_md_op_data(op_data);
                         break;
@@ -855,7 +855,7 @@ static int ll_symlink_generic(struct inode *dir, struct dentry *dchild,
                 RETURN(-ENOMEM);
 
         /* allocate new fid */
-        err = ll_fid_md_alloc(ll_i2sbi(dir), &op_data->fid2, &hint);
+        err = ll_fid_md_alloc(ll_i2sbi(dir), &op_data->op_fid2, &hint);
         if (err) {
                 ll_finish_md_op_data(op_data);
                 RETURN(err);
@@ -932,7 +932,7 @@ static int ll_mkdir_generic(struct inode *dir, struct qstr *name,
                 RETURN(-ENOMEM);
 
         /* Allocate new fid. */
-        err = ll_fid_md_alloc(ll_i2sbi(dir), &op_data->fid2, &hint);
+        err = ll_fid_md_alloc(ll_i2sbi(dir), &op_data->op_fid2, &hint);
         if (err) {
                 ll_finish_md_op_data(op_data);
                 RETURN(err);
index c2267c7..c57c4de 100644 (file)
@@ -109,7 +109,7 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm,
         if (op_data == NULL)
                 GOTO(out, rc = -ENOMEM);
 
-        op_data->fid1 = body->fid1;
+        op_data->op_fid1 = body->fid1;
 
         rc = md_intent_lock(tgt_exp, op_data, lmm, lmmsize, it, flags,
                             &req, cb_blocking, extra_lock_flags);
@@ -136,8 +136,8 @@ out:
         return rc;
 }
 
-int lmv_alloc_fid_for_split(struct obd_device *obd, struct lu_fid *pid,
-                            struct md_op_data *op, struct lu_fid *fid)
+int lmv_alloc_slave_fids(struct obd_device *obd, struct lu_fid *pid,
+                         struct md_op_data *op, struct lu_fid *fid)
 {
         struct lmv_obd *lmv = &obd->u.lmv;
         struct lmv_obj *obj;
@@ -155,7 +155,7 @@ int lmv_alloc_fid_for_split(struct obd_device *obd, struct lu_fid *pid,
         }
         
         mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
-                               (char *)op->name, op->namelen);
+                               (char *)op->op_name, op->op_namelen);
         rpid = &obj->lo_inodes[mea_idx].li_fid;
         mds = obj->lo_inodes[mea_idx].li_mds;
         lmv_obj_put(obj);
@@ -185,7 +185,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
 {
         struct obd_device *obd = exp->exp_obd;
         struct obd_export *tgt_exp;
-        struct lu_fid rpid = op_data->fid1;
+        struct lu_fid rpid = op_data->op_fid1;
         struct lmv_obd *lmv = &obd->u.lmv;
         struct mdt_body *body = NULL;
         struct md_op_data *sop_data;
@@ -211,8 +211,8 @@ repeat:
                  * the right MDS.
                  */
                 mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
-                                       (char *)op_data->name,
-                                       op_data->namelen);
+                                       (char *)op_data->op_name,
+                                       op_data->op_namelen);
 
                 rpid = obj->lo_inodes[mea_idx].li_fid;
                 tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
@@ -224,7 +224,7 @@ repeat:
         if (IS_ERR(tgt_exp))
                 GOTO(out_free_sop_data, rc = PTR_ERR(tgt_exp));
         
-        sop_data->fid1 = rpid;
+        sop_data->op_fid1 = rpid;
 
         rc = md_intent_lock(tgt_exp, sop_data, lmm, lmmsize, it, flags,
                             reqp, cb_blocking, extra_lock_flags);
@@ -240,12 +240,12 @@ repeat:
                  * Directory got split. Time to update local object and repeat
                  * the request with proper MDS.
                  */
-                LASSERT(lu_fid_eq(&op_data->fid1, &rpid));
+                LASSERT(lu_fid_eq(&op_data->op_fid1, &rpid));
                 rc = lmv_handle_split(exp, &rpid);
                 if (rc == 0) {
                         /* We should reallocate child FID. */
-                        rc = lmv_alloc_fid_for_split(obd, &rpid, op_data,
-                                                     &sop_data->fid2);
+                        rc = lmv_alloc_slave_fids(obd, &rpid, op_data,
+                                                  &sop_data->op_fid2);
                         if (rc == 0)
                                 goto repeat;
                 }
@@ -269,13 +269,13 @@ repeat:
                  * only debug info.
                  */
                 CDEBUG(D_OTHER, "can't handle remote %s: dir "DFID"("DFID"):"
-                       "%*s: %d\n", LL_IT2STR(it), PFID(&op_data->fid2),
-                       PFID(&rpid), op_data->namelen, op_data->name, rc);
+                       "%*s: %d\n", LL_IT2STR(it), PFID(&op_data->op_fid2),
+                       PFID(&rpid), op_data->op_namelen, op_data->op_name, rc);
                 GOTO(out_free_sop_data, rc);
         }
 
         /*
-         * nothing is found, do not access body->fid1 as it is zero and thus
+         * Nothing is found, do not access body->fid1 as it is zero and thus
          * pointless.
          */
         if ((it->d.lustre.it_disposition & DISP_LOOKUP_NEG) &&
@@ -331,7 +331,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
 {
         struct lmv_obj *obj = NULL, *obj2 = NULL;
         struct obd_device *obd = exp->exp_obd;
-        struct lu_fid rpid = op_data->fid1;
+        struct lu_fid rpid = op_data->op_fid1;
         struct lmv_obd *lmv = &obd->u.lmv;
         struct mdt_body *body = NULL;
         struct md_op_data *sop_data;
@@ -347,15 +347,15 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
         /* save op_data fro repeat case */
         *sop_data = *op_data;
 
-        if (fid_is_sane(&op_data->fid2)) {
+        if (fid_is_sane(&op_data->op_fid2)) {
                 /*
                  * Caller wants to revalidate attrs of obj we have to revalidate
                  * slaves if requested object is split directory.
                  */
                 CDEBUG(D_OTHER, "revalidate attrs for "DFID"\n",
-                       PFID(&op_data->fid2));
+                       PFID(&op_data->op_fid2));
 
-                rc = lmv_fld_lookup(lmv, &op_data->fid2, &mds);
+                rc = lmv_fld_lookup(lmv, &op_data->op_fid2, &mds);
                 if (rc)
                         GOTO(out_free_sop_data, rc);
 #if 0
@@ -363,9 +363,9 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
                  * In fact, we do not need this with current intent_lock(), but
                  * it may change some day.
                  */
-                obj = lmv_obj_grab(obd, &op_data->fid2);
+                obj = lmv_obj_grab(obd, &op_data->op_fid2);
                 if (obj) {
-                        if (!lu_fid_eq(&op_data->fid1, &op_data->fid2)){
+                        if (!lu_fid_eq(&op_data->op_fid1, &op_data->op_fid2)){
                                 rpid = obj->lo_inodes[mds].li_fid;
                                 mds = obj->lo_inodes[mds].li_mds;
                         }
@@ -374,19 +374,20 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
 #endif
         } else {
                 CDEBUG(D_OTHER, "INTENT getattr for %*s on "DFID"\n",
-                       op_data->namelen, op_data->name,
-                       PFID(&op_data->fid1));
+                       op_data->op_namelen, op_data->op_name,
+                       PFID(&op_data->op_fid1));
 
-                rc = lmv_fld_lookup(lmv, &op_data->fid1, &mds);
+                rc = lmv_fld_lookup(lmv, &op_data->op_fid1, &mds);
                 if (rc)
                         GOTO(out_free_sop_data, rc);
-                obj = lmv_obj_grab(obd, &op_data->fid1);
-                if (obj && op_data->namelen) {
+                obj = lmv_obj_grab(obd, &op_data->op_fid1);
+                if (obj && op_data->op_namelen) {
                         int mea_idx;
+                        
                         /* directory is already split. calculate mds */
                         mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
-                                               (char *)op_data->name,
-                                               op_data->namelen);
+                                               (char *)op_data->op_name,
+                                               op_data->op_namelen);
                         rpid = obj->lo_inodes[mea_idx].li_fid;
                         mds = obj->lo_inodes[mea_idx].li_mds;
                         lmv_obj_put(obj);
@@ -394,13 +395,13 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
                         CDEBUG(D_OTHER, "forward to MDS #"LPU64" (slave "DFID")\n",
                                mds, PFID(&rpid));
                 } else {
-                        rc = lmv_fld_lookup(lmv, &op_data->fid1, &mds);
+                        rc = lmv_fld_lookup(lmv, &op_data->op_fid1, &mds);
                         if (rc)
                                 GOTO(out_free_sop_data, rc);
                 }
         }
 
-        sop_data->fid1 = rpid;
+        sop_data->op_fid1 = rpid;
 
         rc = md_intent_lock(lmv->tgts[mds].ltd_exp, sop_data, lmm,
                             lmmsize, it, flags, reqp, cb_blocking,
@@ -421,10 +422,10 @@ int lmv_intent_getattr(struct obd_export *exp, struct md_op_data *op_data,
                  */
                 CDEBUG(D_OTHER,
                        "revalidate slaves for "DFID", rc %d\n",
-                       PFID(&op_data->fid2), rc);
+                       PFID(&op_data->op_fid2), rc);
 
-                LASSERT(fid_is_sane(&op_data->fid2));
-                rc = lmv_revalidate_slaves(exp, reqp, &op_data->fid2, it, rc,
+                LASSERT(fid_is_sane(&op_data->op_fid2));
+                rc = lmv_revalidate_slaves(exp, reqp, &op_data->op_fid2, it, rc,
                                            cb_blocking, extra_lock_flags);
                 GOTO(out_free_sop_data, rc);
         }
@@ -552,8 +553,8 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp)
                 it.it_op = IT_GETATTR;
 
                 memset(op_data, 0, sizeof(*op_data));
-                op_data->fid1 = fid;
-                op_data->fid2 = fid;
+                op_data->op_fid1 = fid;
+                op_data->op_fid2 = fid;
 
                 tgt_exp = lmv_get_export(lmv, obj->lo_inodes[i].li_mds);
                 if (IS_ERR(tgt_exp))
@@ -616,7 +617,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
                       int extra_lock_flags)
 {
         struct obd_device *obd = exp->exp_obd;
-        struct lu_fid rpid = op_data->fid1;
+        struct lu_fid rpid = op_data->op_fid1;
         struct lmv_obd *lmv = &obd->u.lmv;
         struct mdt_body *body = NULL;
         struct md_op_data *sop_data;
@@ -637,22 +638,22 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
         /*
          * IT_LOOKUP is intended to produce name -> fid resolving (let's call
          * this lookup below) or to confirm requested resolving is still valid
-         * (let's call this revalidation) fid_is_sane(&sop_data->fid2) specifies
+         * (let's call this revalidation) fid_is_sane(&sop_data->op_fid2) specifies
          * revalidation.
          */
-        if (fid_is_sane(&op_data->fid2)) {
+        if (fid_is_sane(&op_data->op_fid2)) {
                 /*
                  * This is revalidate: we have to check is LOOKUP lock still
                  * valid for given fid. Very important part is that we have to
                  * choose right mds because namespace is per mds.
                  */
-                rpid = op_data->fid1;
+                rpid = op_data->op_fid1;
                 obj = lmv_obj_grab(obd, &rpid);
                 if (obj) {
                         mea_idx = raw_name2idx(obj->lo_hashtype,
                                                obj->lo_objcount,
-                                               (char *)op_data->name,
-                                               op_data->namelen);
+                                               (char *)op_data->op_name,
+                                               op_data->op_namelen);
                         rpid = obj->lo_inodes[mea_idx].li_fid;
                         mds = obj->lo_inodes[mea_idx].li_mds;
                         lmv_obj_put(obj);
@@ -663,7 +664,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
                 }
 
                 CDEBUG(D_OTHER, "revalidate lookup for "DFID" to #"LPU64" MDS\n",
-                       PFID(&op_data->fid2), mds);
+                       PFID(&op_data->op_fid2), mds);
         } else {
 repeat:
                 LASSERT(++loop <= 2);
@@ -673,32 +674,32 @@ repeat:
                  * attributes, because returned values will be put in struct
                  * inode.
                  */
-                obj = lmv_obj_grab(obd, &op_data->fid1);
+                obj = lmv_obj_grab(obd, &op_data->op_fid1);
                 if (obj) {
-                        if (op_data->namelen) {
+                        if (op_data->op_namelen) {
                                 /* directory is already split. calculate mds */
                                 mea_idx = raw_name2idx(obj->lo_hashtype,
                                                        obj->lo_objcount,
-                                                       (char *)op_data->name,
-                                                       op_data->namelen);
+                                                       (char *)op_data->op_name,
+                                                       op_data->op_namelen);
                                 rpid = obj->lo_inodes[mea_idx].li_fid;
                                 mds = obj->lo_inodes[mea_idx].li_mds;
                         }
                         lmv_obj_put(obj);
                 } else {
-                        rc = lmv_fld_lookup(lmv, &op_data->fid1, &mds);
+                        rc = lmv_fld_lookup(lmv, &op_data->op_fid1, &mds);
                         if (rc)
                                 GOTO(out_free_sop_data, rc);
                 }
-                fid_zero(&sop_data->fid2);
+                fid_zero(&sop_data->op_fid2);
         }
 
-        sop_data->fid1 = rpid;
+        sop_data->op_fid1 = rpid;
 
         rc = md_intent_lock(lmv->tgts[mds].ltd_exp, sop_data, lmm, lmmsize,
                             it, flags, reqp, cb_blocking, extra_lock_flags);
         if (rc > 0) {
-                LASSERT(fid_is_sane(&op_data->fid2));
+                LASSERT(fid_is_sane(&op_data->op_fid2));
                 /*
                  * Very interesting. it seems object is still valid but for some
                  * reason llite calls lookup, not revalidate.
@@ -725,7 +726,7 @@ repeat:
                 it->d.lustre.it_data = 0;
                 /*
                  * Directory got split since last update. This shouldn't be
-                 * becasue splitting causes lock revocation, so revalidate had
+                 * because splitting causes lock revocation, so revalidate had
                  * to fail and lookup on dir had to return mea.
                  */
                 CWARN("we haven't knew about directory splitting!\n");
@@ -786,11 +787,11 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
         ENTRY;
 
         LASSERT(it != NULL);
-        LASSERT(fid_is_sane(&op_data->fid1));
+        LASSERT(fid_is_sane(&op_data->op_fid1));
 
         CDEBUG(D_OTHER, "INTENT LOCK '%s' for '%*s' on "DFID"\n",
-               LL_IT2STR(it), op_data->namelen, op_data->name,
-               PFID(&op_data->fid1));
+               LL_IT2STR(it), op_data->op_namelen, op_data->op_name,
+               PFID(&op_data->op_fid1));
 
         rc = lmv_check_connect(obd);
         if (rc)
@@ -889,8 +890,8 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp,
                         cb = cb_blocking;
                 }
 
-                op_data->fid1 = fid;
-                op_data->fid2 = fid;
+                op_data->op_fid1 = fid;
+                op_data->op_fid2 = fid;
 
                 /* is obj valid? */
                 tgt_exp = lmv_get_export(lmv, obj->lo_inodes[i].li_mds);
index cb60b10..8b7d823 100644 (file)
@@ -141,8 +141,8 @@ int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid,
                    mdsno_t *mds);
 int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid,
                     mdsno_t mds);
-int lmv_alloc_fid_for_split(struct obd_device *obd, struct lu_fid *pid,
-                            struct md_op_data *op, struct lu_fid *fid);
+int lmv_alloc_slave_fids(struct obd_device *obd, struct lu_fid *pid,
+                         struct md_op_data *op, struct lu_fid *fid);
 
 static inline struct lmv_stripe_md * 
 lmv_get_mea(struct ptlrpc_request *req, int offset)
index 63e282c..184b3fb 100644 (file)
@@ -1219,11 +1219,11 @@ static int lmv_close(struct obd_export *exp,
         if (rc)
                 RETURN(rc);
 
-        tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+        tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
 
-        CDEBUG(D_OTHER, "CLOSE "DFID"\n", PFID(&op_data->fid1));
+        CDEBUG(D_OTHER, "CLOSE "DFID"\n", PFID(&op_data->op_fid1));
         rc = md_close(tgt_exp, op_data, och, request);
         RETURN(rc);
 }
@@ -1304,31 +1304,31 @@ int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
                 RETURN(-EIO);
 repeat:
         LASSERT(++loop <= 2);
-        obj = lmv_obj_grab(obd, &op_data->fid1);
+        obj = lmv_obj_grab(obd, &op_data->op_fid1);
         if (obj) {
                 int mea_idx;
 
                 mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
-                                       op_data->name, op_data->namelen);
-                op_data->fid1 = obj->lo_inodes[mea_idx].li_fid;
+                                       op_data->op_name, op_data->op_namelen);
+                op_data->op_fid1 = obj->lo_inodes[mea_idx].li_fid;
                 tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
                 lmv_obj_put(obj);
         } else {
-                tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+                tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
         }
 
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
 
-        CDEBUG(D_OTHER, "CREATE '%*s' on "DFID"\n", op_data->namelen,
-               op_data->name, PFID(&op_data->fid1));
+        CDEBUG(D_OTHER, "CREATE '%*s' on "DFID"\n", op_data->op_namelen,
+               op_data->op_name, PFID(&op_data->op_fid1));
 
         rc = md_create(tgt_exp, op_data, data, datalen, mode, uid, gid,
                        cap_effective, rdev, request);
         if (rc == 0) {
                 if (*request == NULL)
                         RETURN(rc);
-                CDEBUG(D_OTHER, "created. "DFID"\n", PFID(&op_data->fid1));
+                CDEBUG(D_OTHER, "created. "DFID"\n", PFID(&op_data->op_fid1));
         } else if (rc == -ERESTART) {
                 LASSERT(*request != NULL);
                 DEBUG_REQ(D_WARNING|D_RPCTRACE, *request, 
@@ -1339,10 +1339,10 @@ repeat:
                  * Directory got split. Time to update local object and repeat
                  * the request with proper MDS.
                  */
-                rc = lmv_handle_split(exp, &op_data->fid1);
+                rc = lmv_handle_split(exp, &op_data->op_fid1);
                 if (rc == 0) {
-                        rc = lmv_alloc_fid_for_split(obd, &op_data->fid1,
-                                                     op_data, &op_data->fid2);
+                        rc = lmv_alloc_slave_fids(obd, &op_data->op_fid1,
+                                                  op_data, &op_data->op_fid2);
                         if (rc)
                                 RETURN(rc);
                         goto repeat;
@@ -1365,7 +1365,7 @@ static int lmv_done_writing(struct obd_export *exp,
         if (rc)
                 RETURN(rc);
 
-        tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+        tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
 
@@ -1382,7 +1382,7 @@ lmv_enqueue_slaves(struct obd_export *exp, int locktype,
 {
         struct obd_device *obd = exp->exp_obd;
         struct lmv_obd *lmv = &obd->u.lmv;
-        struct lmv_stripe_md *mea = op_data->mea1;
+        struct lmv_stripe_md *mea = op_data->op_mea1;
         struct md_op_data *op_data2;
         struct obd_export *tgt_exp;
         int i, rc = 0;
@@ -1395,9 +1395,9 @@ lmv_enqueue_slaves(struct obd_export *exp, int locktype,
         LASSERT(mea != NULL);
         for (i = 0; i < mea->mea_count; i++) {
                 memset(op_data2, 0, sizeof(*op_data2));
-                op_data2->fid1 = mea->mea_ids[i];
+                op_data2->op_fid1 = mea->mea_ids[i];
 
-                tgt_exp = lmv_find_export(lmv, &op_data2->fid1);
+                tgt_exp = lmv_find_export(lmv, &op_data2->op_fid1);
                 if (IS_ERR(tgt_exp))
                         GOTO(cleanup, rc = PTR_ERR(tgt_exp));
 
@@ -1466,7 +1466,7 @@ lmv_enqueue_remote(struct obd_export *exp, int lock_type,
                 RETURN(0);
 
         CDEBUG(D_OTHER, "ENQUEUE '%s' on "DFID" -> "DFID"\n",
-               LL_IT2STR(it), PFID(&op_data->fid1), PFID(&body->fid1));
+               LL_IT2STR(it), PFID(&op_data->op_fid1), PFID(&body->fid1));
 
         /* We got LOOKUP lock, but we really need attrs */
         pmode = it->d.lustre.it_lock_mode;
@@ -1487,9 +1487,9 @@ lmv_enqueue_remote(struct obd_export *exp, int lock_type,
         if (rdata == NULL)
                 GOTO(out, rc = -ENOMEM);
 
-        rdata->fid1 = fid_copy;
-        rdata->name = NULL;
-        rdata->namelen = 0;
+        rdata->op_fid1 = fid_copy;
+        rdata->op_name = NULL;
+        rdata->op_namelen = 0;
 
         rc = md_enqueue(tgt_exp, lock_type, it, lock_mode, rdata,
                         lockh, lmm, lmmsize, cb_compl, cb_blocking,
@@ -1520,15 +1520,15 @@ lmv_enqueue(struct obd_export *exp, int lock_type,
         if (rc)
                 RETURN(rc);
 
-        if (op_data->mea1 && it->it_op == IT_UNLINK) {
+        if (op_data->op_mea1 && it->it_op == IT_UNLINK) {
                 rc = lmv_enqueue_slaves(exp, lock_type, it, lock_mode,
                                         op_data, lockh, lmm, lmmsize,
                                         cb_compl, cb_blocking, cb_data);
                 RETURN(rc);
         }
 
-        if (op_data->namelen) {
-                obj = lmv_obj_grab(obd, &op_data->fid1);
+        if (op_data->op_namelen) {
+                obj = lmv_obj_grab(obd, &op_data->op_fid1);
                 if (obj) {
                         int mea_idx;
 
@@ -1536,21 +1536,21 @@ lmv_enqueue(struct obd_export *exp, int lock_type,
                          * name */
                         mea_idx = raw_name2idx(obj->lo_hashtype,
                                                obj->lo_objcount,
-                                               (char *)op_data->name,
-                                               op_data->namelen);
-                        op_data->fid1 = obj->lo_inodes[mea_idx].li_fid;
+                                               (char *)op_data->op_name,
+                                               op_data->op_namelen);
+                        op_data->op_fid1 = obj->lo_inodes[mea_idx].li_fid;
                         tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
                         lmv_obj_put(obj);
                 }
         }
 
         if (tgt_exp == NULL)
-                tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+                tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
 
         CDEBUG(D_OTHER, "ENQUEUE '%s' on "DFID"\n", LL_IT2STR(it),
-               PFID(&op_data->fid1));
+               PFID(&op_data->op_fid1));
 
         rc = md_enqueue(tgt_exp, lock_type, it, lock_mode, op_data, lockh,
                         lmm, lmmsize, cb_compl, cb_blocking, cb_data,
@@ -1644,8 +1644,8 @@ repeat:
 }
 
 /*
- * llite passes fid of an target inode in op_data->fid1 and id of directory in
- * op_data->fid2
+ * llite passes fid of an target inode in op_data->op_fid1 and id of directory in
+ * op_data->op_fid2
  */
 static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
                     struct ptlrpc_request **request)
@@ -1661,43 +1661,43 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
        if (rc)
                RETURN(rc);
 
-        if (op_data->namelen != 0) {
+        if (op_data->op_namelen != 0) {
                 int mea_idx;
                 /* usual link request */
-                obj = lmv_obj_grab(obd, &op_data->fid2);
+                obj = lmv_obj_grab(obd, &op_data->op_fid2);
                 if (obj) {
                         mea_idx = raw_name2idx(obj->lo_hashtype,
                                                obj->lo_objcount,
-                                               op_data->name,
-                                               op_data->namelen);
-                        op_data->fid2 = obj->lo_inodes[mea_idx].li_fid;
+                                               op_data->op_name,
+                                               op_data->op_namelen);
+                        op_data->op_fid2 = obj->lo_inodes[mea_idx].li_fid;
                         mds = obj->lo_inodes[mea_idx].li_mds;
                         lmv_obj_put(obj);
                 } else {
-                        rc = lmv_fld_lookup(lmv, &op_data->fid2, &mds);
+                        rc = lmv_fld_lookup(lmv, &op_data->op_fid2, &mds);
                         if (rc)
                                 RETURN(rc);
                 }
 
                 CDEBUG(D_OTHER,"link "DFID":%*s to "DFID"\n",
-                       PFID(&op_data->fid2), op_data->namelen,
-                       op_data->name, PFID(&op_data->fid1));
+                       PFID(&op_data->op_fid2), op_data->op_namelen,
+                       op_data->op_name, PFID(&op_data->op_fid1));
         } else {
-                rc = lmv_fld_lookup(lmv, &op_data->fid1, &mds);
+                rc = lmv_fld_lookup(lmv, &op_data->op_fid1, &mds);
                 if (rc)
                         RETURN(rc);
 
                 /* request from MDS to acquire i_links for inode by fid1 */
                 CDEBUG(D_OTHER, "inc i_nlinks for "DFID"\n",
-                       PFID(&op_data->fid1));
+                       PFID(&op_data->op_fid1));
         }
 
         CDEBUG(D_OTHER, "forward to MDS #"LPU64" ("DFID")\n",
-               mds, PFID(&op_data->fid1));
+               mds, PFID(&op_data->op_fid1));
 
-        op_data->fsuid = current->fsuid;
-        op_data->fsgid = current->fsgid;
-        op_data->cap   = current->cap_effective;
+        op_data->op_fsuid = current->fsuid;
+        op_data->op_fsgid = current->fsgid;
+        op_data->op_cap   = current->cap_effective;
         rc = md_link(lmv->tgts[mds].ltd_exp, op_data, request);
 
         RETURN(rc);
@@ -1715,8 +1715,8 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
         ENTRY;
 
         CDEBUG(D_OTHER, "rename %*s in "DFID" to %*s in "DFID"\n",
-               oldlen, old, PFID(&op_data->fid1),
-               newlen, new, PFID(&op_data->fid2));
+               oldlen, old, PFID(&op_data->op_fid1),
+               newlen, new, PFID(&op_data->op_fid2));
 
         rc = lmv_check_connect(obd);
        if (rc)
@@ -1730,9 +1730,9 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
                 CDEBUG(D_OTHER,
                        "create %*s(%d/%d) in "DFID" pointing "
                        "to "DFID"\n", newlen, new, oldlen, newlen,
-                       PFID(&op_data->fid2), PFID(&op_data->fid1));
+                       PFID(&op_data->op_fid2), PFID(&op_data->op_fid1));
 
-                rc = lmv_fld_lookup(lmv, &op_data->fid2, &mds);
+                rc = lmv_fld_lookup(lmv, &op_data->op_fid2, &mds);
                 if (rc)
                         RETURN(rc);
 
@@ -1740,20 +1740,20 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
                  * target directory can be split, sowe should forward request to
                  * the right MDS.
                  */
-                obj = lmv_obj_grab(obd, &op_data->fid2);
+                obj = lmv_obj_grab(obd, &op_data->op_fid2);
                 if (obj) {
                         mea_idx = raw_name2idx(obj->lo_hashtype,
                                                obj->lo_objcount,
                                                (char *)new, newlen);
-                        op_data->fid2 = obj->lo_inodes[mea_idx].li_fid;
+                        op_data->op_fid2 = obj->lo_inodes[mea_idx].li_fid;
                         CDEBUG(D_OTHER, "Parent obj "DFID"\n",
-                               PFID(&op_data->fid2));
+                               PFID(&op_data->op_fid2));
                         lmv_obj_put(obj);
                 }
                 goto request;
         }
 
-        obj = lmv_obj_grab(obd, &op_data->fid1);
+        obj = lmv_obj_grab(obd, &op_data->op_fid1);
         if (obj) {
                 /*
                  * directory is already split, so we have to forward request to
@@ -1761,17 +1761,17 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
                  */
                 mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
                                        (char *)old, oldlen);
-                op_data->fid1 = obj->lo_inodes[mea_idx].li_fid;
+                op_data->op_fid1 = obj->lo_inodes[mea_idx].li_fid;
                 mds = obj->lo_inodes[mea_idx].li_mds;
-                CDEBUG(D_OTHER, "Parent obj "DFID"\n", PFID(&op_data->fid1));
+                CDEBUG(D_OTHER, "Parent obj "DFID"\n", PFID(&op_data->op_fid1));
                 lmv_obj_put(obj);
         } else {
-                rc = lmv_fld_lookup(lmv, &op_data->fid1, &mds);
+                rc = lmv_fld_lookup(lmv, &op_data->op_fid1, &mds);
                 if (rc)
                         RETURN(rc);
         }
 
-        obj = lmv_obj_grab(obd, &op_data->fid2);
+        obj = lmv_obj_grab(obd, &op_data->op_fid2);
         if (obj) {
                 /*
                  * directory is already split, so we have to forward request to
@@ -1780,14 +1780,14 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
                 mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
                                        (char *)new, newlen);
 
-                op_data->fid2 = obj->lo_inodes[mea_idx].li_fid;
-                CDEBUG(D_OTHER, "Parent obj "DFID"\n", PFID(&op_data->fid2));
+                op_data->op_fid2 = obj->lo_inodes[mea_idx].li_fid;
+                CDEBUG(D_OTHER, "Parent obj "DFID"\n", PFID(&op_data->op_fid2));
                 lmv_obj_put(obj);
         }
 request:
-        op_data->fsuid = current->fsuid;
-        op_data->fsgid = current->fsgid;
-        op_data->cap   = current->cap_effective;
+        op_data->op_fsuid = current->fsuid;
+        op_data->op_fsgid = current->fsgid;
+        op_data->op_cap   = current->cap_effective;
         rc = md_rename(lmv->tgts[mds].ltd_exp, op_data, old, oldlen,
                        new, newlen, request);
         RETURN(rc);
@@ -1809,15 +1809,15 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
        if (rc)
                RETURN(rc);
 
-        obj = lmv_obj_grab(obd, &op_data->fid1);
+        obj = lmv_obj_grab(obd, &op_data->op_fid1);
 
         CDEBUG(D_OTHER, "SETATTR for "DFID", valid 0x%x%s\n",
-               PFID(&op_data->fid1), op_data->attr.ia_valid,
+               PFID(&op_data->op_fid1), op_data->op_attr.ia_valid,
                obj ? ", split" : "");
 
         if (obj) {
                 for (i = 0; i < obj->lo_objcount; i++) {
-                        op_data->fid1 = obj->lo_inodes[i].li_fid;
+                        op_data->op_fid1 = obj->lo_inodes[i].li_fid;
 
                         tgt_exp = lmv_get_export(lmv, obj->lo_inodes[i].li_mds);
                         if (IS_ERR(tgt_exp)) {
@@ -1843,7 +1843,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
                 }
                 lmv_obj_put(obj);
         } else {
-                tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+                tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
                 if (IS_ERR(tgt_exp))
                         RETURN(PTR_ERR(tgt_exp));
 
@@ -1991,7 +1991,7 @@ static int lmv_unlink_slaves(struct obd_export *exp,
 {
         struct obd_device *obd = exp->exp_obd;
         struct lmv_obd *lmv = &obd->u.lmv;
-        struct lmv_stripe_md *mea = op_data->mea1;
+        struct lmv_stripe_md *mea = op_data->op_mea1;
         struct md_op_data *op_data2;
         struct obd_export *tgt_exp;
         int i, rc = 0;
@@ -2004,11 +2004,11 @@ static int lmv_unlink_slaves(struct obd_export *exp,
         LASSERT(mea != NULL);
         for (i = 0; i < mea->mea_count; i++) {
                 memset(op_data2, 0, sizeof(*op_data2));
-                op_data2->fid1 = mea->mea_ids[i];
-                op_data2->mode = MDS_MODE_DONT_LOCK | S_IFDIR;
-                op_data2->fsuid = current->fsuid;
-                op_data2->fsgid = current->fsgid;
-                tgt_exp = lmv_find_export(lmv, &op_data2->fid1);
+                op_data2->op_fid1 = mea->mea_ids[i];
+                op_data2->op_mode = MDS_MODE_DONT_LOCK | S_IFDIR;
+                op_data2->op_fsuid = current->fsuid;
+                op_data2->op_fsgid = current->fsgid;
+                tgt_exp = lmv_find_export(lmv, &op_data2->op_fid1);
                 if (IS_ERR(tgt_exp))
                         GOTO(out_free_op_data2, rc = PTR_ERR(tgt_exp));
 
@@ -2047,41 +2047,41 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data,
        if (rc)
                RETURN(rc);
 
-        if (op_data->namelen == 0 && op_data->mea1 != NULL) {
+        if (op_data->op_namelen == 0 && op_data->op_mea1 != NULL) {
                 /* mds asks to remove slave objects */
                 rc = lmv_unlink_slaves(exp, op_data, request);
                 RETURN(rc);
         }
 
-        if (op_data->namelen != 0) {
+        if (op_data->op_namelen != 0) {
                 struct lmv_obj *obj;
                 int mea_idx;
 
-                obj = lmv_obj_grab(obd, &op_data->fid1);
+                obj = lmv_obj_grab(obd, &op_data->op_fid1);
                 if (obj) {
                         mea_idx = raw_name2idx(obj->lo_hashtype,
                                                obj->lo_objcount,
-                                               op_data->name,
-                                               op_data->namelen);
-                        op_data->fid1 = obj->lo_inodes[mea_idx].li_fid;
+                                               op_data->op_name,
+                                               op_data->op_namelen);
+                        op_data->op_fid1 = obj->lo_inodes[mea_idx].li_fid;
                         tgt_exp = lmv_get_export(lmv,
                                                  obj->lo_inodes[mea_idx].li_mds);
                         lmv_obj_put(obj);
                         CDEBUG(D_OTHER, "unlink '%*s' in "DFID" -> %u\n",
-                               op_data->namelen, op_data->name,
-                               PFID(&op_data->fid1), mea_idx);
+                               op_data->op_namelen, op_data->op_name,
+                               PFID(&op_data->op_fid1), mea_idx);
                 }
         } else {
                 CDEBUG(D_OTHER, "drop i_nlink on "DFID"\n",
-                       PFID(&op_data->fid1));
+                       PFID(&op_data->op_fid1));
         }
         if (tgt_exp == NULL)
-                tgt_exp = lmv_find_export(lmv, &op_data->fid1);
+                tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
-        op_data->fsuid = current->fsuid;
-        op_data->fsgid = current->fsgid;
-        op_data->cap   = current->cap_effective;
+        op_data->op_fsuid = current->fsuid;
+        op_data->op_fsgid = current->fsgid;
+        op_data->op_cap   = current->cap_effective;
         rc = md_unlink(tgt_exp, op_data, request);
         RETURN(rc);
 }
index 7e6cc61..a828ae5 100644 (file)
@@ -121,18 +121,18 @@ void mdc_create_pack(struct ptlrpc_request *req, int offset,
         rec->cr_fsuid = uid;
         rec->cr_fsgid = gid;
         rec->cr_cap = cap_effective;
-        rec->cr_fid1 = op_data->fid1;
-        rec->cr_fid2 = op_data->fid2;
+        rec->cr_fid1 = op_data->op_fid1;
+        rec->cr_fid2 = op_data->op_fid2;
         rec->cr_mode = mode;
         rec->cr_rdev = rdev;
-        rec->cr_time = op_data->mod_time;
-        rec->cr_suppgid = op_data->suppgids[0];
-        rec->cr_flags = op_data->flags;
+        rec->cr_time = op_data->op_mod_time;
+        rec->cr_suppgid = op_data->op_suppgids[0];
+        rec->cr_flags = op_data->op_flags;
 
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
 
-        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, op_data->namelen + 1);
-        LOGL0(op_data->name, op_data->namelen, tmp);
+        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, op_data->op_namelen + 1);
+        LOGL0(op_data->op_name, op_data->op_namelen, tmp);
 
         if (data) {
                 tmp = lustre_msg_buf(req->rq_reqmsg, offset + 3, datalen);
@@ -168,7 +168,7 @@ void mdc_join_pack(struct ptlrpc_request *req, int offset,
 
         rec = lustre_msg_buf(req->rq_reqmsg, offset, sizeof(*rec));
         LASSERT(rec != NULL);
-        rec->jr_fid = op_data->fid2;
+        rec->jr_fid = op_data->op_fid2;
         rec->jr_headsize = head_size;
 }
 
@@ -186,30 +186,30 @@ void mdc_open_pack(struct ptlrpc_request *req, int offset,
         rec->cr_fsgid = current->fsgid;
         rec->cr_cap = current->cap_effective;
         if (op_data != NULL) {
-                rec->cr_fid1 = op_data->fid1;
-                rec->cr_fid2 = op_data->fid2;
+                rec->cr_fid1 = op_data->op_fid1;
+                rec->cr_fid2 = op_data->op_fid2;
         }
         rec->cr_mode = mode;
         rec->cr_flags = mds_pack_open_flags(flags);
         rec->cr_rdev = rdev;
-        rec->cr_time = op_data->mod_time;
-        rec->cr_suppgid = op_data->suppgids[0];
+        rec->cr_time = op_data->op_mod_time;
+        rec->cr_suppgid = op_data->op_suppgids[0];
 
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
         /* the next buffer is child capa, which is used for replay,
          * will be packed from the data in reply message. */
 
-        if (op_data->name) {
+        if (op_data->op_name) {
                 tmp = lustre_msg_buf(req->rq_reqmsg, offset + 3,
-                                     op_data->namelen + 1);
-                LOGL0(op_data->name, op_data->namelen, tmp);
+                                     op_data->op_namelen + 1);
+                LOGL0(op_data->op_name, op_data->op_namelen, tmp);
         }
 
         if (lmm) {
                 rec->cr_flags |= MDS_OPEN_HAS_EA;
 #ifndef __KERNEL__
                 /*XXX a hack for liblustre to set EA (LL_IOC_LOV_SETSTRIPE) */
-                rec->cr_fid2 = op_data->fid2;
+                rec->cr_fid2 = op_data->op_fid2;
 #endif
                 tmp = lustre_msg_buf(req->rq_reqmsg, offset + 4, lmmlen);
                 memcpy (tmp, lmm, lmmlen);
@@ -225,29 +225,29 @@ static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec,
         rec->sa_cap = current->cap_effective;
         rec->sa_suppgid = -1;
 
-        rec->sa_fid = op_data->fid1;
-        rec->sa_valid = op_data->attr.ia_valid;
-        rec->sa_mode = op_data->attr.ia_mode;
-        rec->sa_uid = op_data->attr.ia_uid;
-        rec->sa_gid = op_data->attr.ia_gid;
-        rec->sa_size = op_data->attr.ia_size;
-        rec->sa_blocks = op_data->attr_blocks;
-        rec->sa_atime = LTIME_S(op_data->attr.ia_atime);
-        rec->sa_mtime = LTIME_S(op_data->attr.ia_mtime);
-        rec->sa_ctime = LTIME_S(op_data->attr.ia_ctime);
-        rec->sa_attr_flags = ((struct ll_iattr *)&op_data->attr)->ia_attr_flags;
-        if ((op_data->attr.ia_valid & ATTR_GID) &&
-            in_group_p(op_data->attr.ia_gid))
-                rec->sa_suppgid = op_data->attr.ia_gid;
+        rec->sa_fid = op_data->op_fid1;
+        rec->sa_valid = op_data->op_attr.ia_valid;
+        rec->sa_mode = op_data->op_attr.ia_mode;
+        rec->sa_uid = op_data->op_attr.ia_uid;
+        rec->sa_gid = op_data->op_attr.ia_gid;
+        rec->sa_size = op_data->op_attr.ia_size;
+        rec->sa_blocks = op_data->op_attr_blocks;
+        rec->sa_atime = LTIME_S(op_data->op_attr.ia_atime);
+        rec->sa_mtime = LTIME_S(op_data->op_attr.ia_mtime);
+        rec->sa_ctime = LTIME_S(op_data->op_attr.ia_ctime);
+        rec->sa_attr_flags = ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;
+        if ((op_data->op_attr.ia_valid & ATTR_GID) &&
+            in_group_p(op_data->op_attr.ia_gid))
+                rec->sa_suppgid = op_data->op_attr.ia_gid;
         else
-                rec->sa_suppgid = op_data->suppgids[0];
+                rec->sa_suppgid = op_data->op_suppgids[0];
 }
 
 static void mdc_epoch_pack(struct mdt_epoch *epoch, struct md_op_data *op_data)
 {
-        memcpy(&epoch->handle, &op_data->handle, sizeof(epoch->handle));
-        epoch->ioepoch = op_data->ioepoch;
-        epoch->flags = op_data->flags;
+        memcpy(&epoch->handle, &op_data->op_handle, sizeof(epoch->handle));
+        epoch->ioepoch = op_data->op_ioepoch;
+        epoch->flags = op_data->op_flags;
 }
 
 void mdc_setattr_pack(struct ptlrpc_request *req, int offset,
@@ -260,9 +260,9 @@ void mdc_setattr_pack(struct ptlrpc_request *req, int offset,
         rec = lustre_msg_buf(req->rq_reqmsg, offset, sizeof (*rec));        
         mdc_setattr_pack_rec(rec, op_data);
 
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
 
-        if (op_data->flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) {
+        if (op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) {
                 epoch = lustre_msg_buf(req->rq_reqmsg, offset + 2,
                                         sizeof(*epoch));
                 mdc_epoch_pack(epoch, op_data);
@@ -289,20 +289,20 @@ void mdc_unlink_pack(struct ptlrpc_request *req, int offset,
         LASSERT (rec != NULL);
 
         rec->ul_opcode = REINT_UNLINK;
-        rec->ul_fsuid = op_data->fsuid;//current->fsuid;
-        rec->ul_fsgid = op_data->fsgid;//current->fsgid;
-        rec->ul_cap = op_data->cap;//current->cap_effective;
-        rec->ul_mode = op_data->mode;
-        rec->ul_suppgid = op_data->suppgids[0];
-        rec->ul_fid1 = op_data->fid1;
-        rec->ul_fid2 = op_data->fid2;
-        rec->ul_time = op_data->mod_time;
-
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
-
-        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, op_data->namelen + 1);
+        rec->ul_fsuid = op_data->op_fsuid;//current->fsuid;
+        rec->ul_fsgid = op_data->op_fsgid;//current->fsgid;
+        rec->ul_cap = op_data->op_cap;//current->cap_effective;
+        rec->ul_mode = op_data->op_mode;
+        rec->ul_suppgid = op_data->op_suppgids[0];
+        rec->ul_fid1 = op_data->op_fid1;
+        rec->ul_fid2 = op_data->op_fid2;
+        rec->ul_time = op_data->op_mod_time;
+
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
+
+        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, op_data->op_namelen + 1);
         LASSERT(tmp != NULL);
-        LOGL0(op_data->name, op_data->namelen, tmp);
+        LOGL0(op_data->op_name, op_data->op_namelen, tmp);
 }
 
 void mdc_link_pack(struct ptlrpc_request *req, int offset,
@@ -314,20 +314,20 @@ void mdc_link_pack(struct ptlrpc_request *req, int offset,
         rec = lustre_msg_buf(req->rq_reqmsg, offset, sizeof (*rec));
 
         rec->lk_opcode = REINT_LINK;
-        rec->lk_fsuid = op_data->fsuid;//current->fsuid;
-        rec->lk_fsgid = op_data->fsgid;//current->fsgid;
-        rec->lk_cap = op_data->cap;//current->cap_effective;
-        rec->lk_suppgid1 = op_data->suppgids[0];
-        rec->lk_suppgid2 = op_data->suppgids[1];
-        rec->lk_fid1 = op_data->fid1;
-        rec->lk_fid2 = op_data->fid2;
-        rec->lk_time = op_data->mod_time;
-
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
-        mdc_pack_capa(req, offset + 2, op_data->mod_capa2);
-
-        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 3, op_data->namelen + 1);
-        LOGL0(op_data->name, op_data->namelen, tmp);
+        rec->lk_fsuid = op_data->op_fsuid;//current->fsuid;
+        rec->lk_fsgid = op_data->op_fsgid;//current->fsgid;
+        rec->lk_cap = op_data->op_cap;//current->cap_effective;
+        rec->lk_suppgid1 = op_data->op_suppgids[0];
+        rec->lk_suppgid2 = op_data->op_suppgids[1];
+        rec->lk_fid1 = op_data->op_fid1;
+        rec->lk_fid2 = op_data->op_fid2;
+        rec->lk_time = op_data->op_mod_time;
+
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
+        mdc_pack_capa(req, offset + 2, op_data->op_mod_capa2);
+
+        tmp = lustre_msg_buf(req->rq_reqmsg, offset + 3, op_data->op_namelen + 1);
+        LOGL0(op_data->op_name, op_data->op_namelen, tmp);
 }
 
 void mdc_rename_pack(struct ptlrpc_request *req, int offset,
@@ -341,18 +341,18 @@ void mdc_rename_pack(struct ptlrpc_request *req, int offset,
 
         /* XXX do something about time, uid, gid */
         rec->rn_opcode = REINT_RENAME;
-        rec->rn_fsuid = op_data->fsuid;//current->fsuid;
-        rec->rn_fsgid = op_data->fsgid;//current->fsgid;
-        rec->rn_cap = op_data->cap;//current->cap_effective;
-        rec->rn_suppgid1 = op_data->suppgids[0];
-        rec->rn_suppgid2 = op_data->suppgids[1];
-        rec->rn_fid1 = op_data->fid1;
-        rec->rn_fid2 = op_data->fid2;
-        rec->rn_time = op_data->mod_time;
-        rec->rn_mode = op_data->mode;
-
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
-        mdc_pack_capa(req, offset + 2, op_data->mod_capa2);
+        rec->rn_fsuid = op_data->op_fsuid;//current->fsuid;
+        rec->rn_fsgid = op_data->op_fsgid;//current->fsgid;
+        rec->rn_cap = op_data->op_cap;//current->cap_effective;
+        rec->rn_suppgid1 = op_data->op_suppgids[0];
+        rec->rn_suppgid2 = op_data->op_suppgids[1];
+        rec->rn_fid1 = op_data->op_fid1;
+        rec->rn_fid2 = op_data->op_fid2;
+        rec->rn_time = op_data->op_mod_time;
+        rec->rn_mode = op_data->op_mode;
+
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
+        mdc_pack_capa(req, offset + 2, op_data->op_mod_capa2);
 
         tmp = lustre_msg_buf(req->rq_reqmsg, offset + 3, oldlen + 1);
         LOGL0(old, oldlen, tmp);
@@ -374,18 +374,18 @@ void mdc_getattr_pack(struct ptlrpc_request *req, int offset, __u64 valid,
         b->capability = current->cap_effective;
         b->valid = valid;
         b->flags = flags | MDS_BFLAG_EXT_FLAGS;
-        b->suppgid = op_data->suppgids[0];
+        b->suppgid = op_data->op_suppgids[0];
 
-        b->fid1 = op_data->fid1;
-        b->fid2 = op_data->fid2;
+        b->fid1 = op_data->op_fid1;
+        b->fid2 = op_data->op_fid2;
 
-        mdc_pack_capa(req, offset + 1, op_data->mod_capa1);
+        mdc_pack_capa(req, offset + 1, op_data->op_mod_capa1);
 
-        if (op_data->name) {
+        if (op_data->op_name) {
                 char *tmp;
                 tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2,
-                                     op_data->namelen + 1);
-                LOGL0(op_data->name, op_data->namelen, tmp);
+                                     op_data->op_namelen + 1);
+                LOGL0(op_data->op_name, op_data->op_namelen, tmp);
         }
 }
 
@@ -399,7 +399,7 @@ void mdc_close_pack(struct ptlrpc_request *req, int offset,
         rec = lustre_msg_buf(req->rq_reqmsg, offset + 1, sizeof(*rec));
 
         mdc_setattr_pack_rec(rec, op_data);
-        mdc_pack_capa(req, offset + 2, op_data->mod_capa1);
+        mdc_pack_capa(req, offset + 2, op_data->op_mod_capa1);
         mdc_epoch_pack(epoch, op_data);
 }
 
index 5d955cb..75c72e5 100644 (file)
@@ -260,9 +260,9 @@ int mdc_enqueue(struct obd_export *exp,
         struct ptlrpc_request *req;
         struct obd_device *obddev = class_exp2obd(exp);
         struct ldlm_res_id res_id =
-                { .name = {fid_seq(&op_data->fid1),
-                           fid_oid(&op_data->fid1),
-                           fid_ver(&op_data->fid1)} };
+                { .name = {fid_seq(&op_data->op_fid1),
+                           fid_oid(&op_data->op_fid1),
+                           fid_ver(&op_data->op_fid1)} };
         ldlm_policy_data_t policy = { .l_inodebits = { MDS_INODELOCK_LOOKUP } };
         struct ldlm_request *lockreq;
         struct ldlm_intent *lit;
@@ -290,11 +290,11 @@ int mdc_enqueue(struct obd_export *exp,
 
                 size[DLM_INTENT_REC_OFF] = sizeof(struct mdt_rec_create);
                 /* parent capability */
-                size[DLM_INTENT_REC_OFF + 1] = op_data->mod_capa1 ?
+                size[DLM_INTENT_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                                sizeof(struct lustre_capa) : 0;
                 /* child capability, used for replay only */
                 size[DLM_INTENT_REC_OFF + 2] = sizeof(struct lustre_capa);
-                size[DLM_INTENT_REC_OFF + 3] = op_data->namelen + 1;
+                size[DLM_INTENT_REC_OFF + 3] = op_data->op_namelen + 1;
                 /* As an optimization, we allocate an RPC request buffer for
                  * at least a default-sized LOV EA even if we aren't sending
                  * one.  We grow the whole request to the next power-of-two
@@ -349,9 +349,9 @@ int mdc_enqueue(struct obd_export *exp,
                 repsize[repbufcnt++] = sizeof(struct lustre_capa);
         } else if (it->it_op & IT_UNLINK) {
                 size[DLM_INTENT_REC_OFF] = sizeof(struct mdt_rec_unlink);
-                size[DLM_INTENT_REC_OFF + 1] = op_data->mod_capa1 ?
+                size[DLM_INTENT_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                                sizeof(struct lustre_capa) : 0;
-                size[DLM_INTENT_REC_OFF + 2] = op_data->namelen + 1;
+                size[DLM_INTENT_REC_OFF + 2] = op_data->op_namelen + 1;
                 policy.l_inodebits.bits = MDS_INODELOCK_UPDATE;
                 req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_DLM_VERSION,
                                       LDLM_ENQUEUE, 6, size, NULL);
@@ -374,9 +374,9 @@ int mdc_enqueue(struct obd_export *exp,
                 valid |= client_is_remote(exp) ? OBD_MD_FLRMTPERM :
                                                  OBD_MD_FLACL;
                 size[DLM_INTENT_REC_OFF] = sizeof(struct mdt_body);
-                size[DLM_INTENT_REC_OFF + 1] = op_data->mod_capa1 ?
+                size[DLM_INTENT_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                                sizeof(struct lustre_capa) : 0;
-                size[DLM_INTENT_REC_OFF + 2] = op_data->namelen + 1;
+                size[DLM_INTENT_REC_OFF + 2] = op_data->op_namelen + 1;
 
                 if (it->it_op & IT_GETATTR)
                         policy.l_inodebits.bits = MDS_INODELOCK_UPDATE;
@@ -642,19 +642,19 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
         LASSERT(it);
 
         CDEBUG(D_DLMTRACE, "(name: %.*s,"DFID") in obj "DFID
-               ", intent: %s flags %#o\n", op_data->namelen,
-               op_data->name, PFID(&op_data->fid2),
-               PFID(&op_data->fid1), ldlm_it2str(it->it_op),
+               ", intent: %s flags %#o\n", op_data->op_namelen,
+               op_data->op_name, PFID(&op_data->op_fid2),
+               PFID(&op_data->op_fid1), ldlm_it2str(it->it_op),
                it->it_flags);
 
-        if (fid_is_sane((struct lu_fid *)&op_data->fid2) &&
+        if (fid_is_sane((struct lu_fid *)&op_data->op_fid2) &&
             (it->it_op & (IT_LOOKUP | IT_GETATTR))) {
                 /* We could just return 1 immediately, but since we should only
                  * be called in revalidate_it if we already have a lock, let's
                  * verify that. */
-                struct ldlm_res_id res_id = { .name = { fid_seq(&op_data->fid2),
-                                                        fid_oid(&op_data->fid2),
-                                                        fid_ver(&op_data->fid2) } };
+                struct ldlm_res_id res_id = { .name = { fid_seq(&op_data->op_fid2),
+                                                        fid_oid(&op_data->op_fid2),
+                                                        fid_ver(&op_data->op_fid2) } };
                 struct lustre_handle lockh;
                 ldlm_policy_data_t policy;
                 ldlm_mode_t mode = LCK_CR;
@@ -701,7 +701,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
                 /* Only return failure if it was not GETATTR by cfid
                    (from inode_revalidate) */
-                if (rc || op_data->namelen != 0)
+                if (rc || op_data->op_namelen != 0)
                         RETURN(rc);
         }
 
@@ -721,7 +721,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                 if (rc < 0)
                         RETURN(rc);
                 memcpy(&it->d.lustre.it_lock_handle, &lockh, sizeof(lockh));
-        } else if (!fid_is_sane(&op_data->fid2) ||
+        } else if (!fid_is_sane(&op_data->op_fid2) ||
                         !(it->it_flags & O_CHECK_STALE)) {
                 /* DISP_ENQ_COMPLETE set means there is extra reference on
                  * request referenced from this intent, saved for subsequent
@@ -762,12 +762,12 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
         /* If we were revalidating a fid/name pair, mark the intent in
          * case we fail and get called again from lookup */
-        if (fid_is_sane(&op_data->fid2) && it->it_flags & O_CHECK_STALE
+        if (fid_is_sane(&op_data->op_fid2) && it->it_flags & O_CHECK_STALE
                         && it->it_op != IT_GETATTR) {
                 it_set_disposition(it, DISP_ENQ_COMPLETE);
 
                 /* Also: did we find the same inode? */
-                if (!lu_fid_eq(&op_data->fid2, &mdt_body->fid1))
+                if (!lu_fid_eq(&op_data->op_fid2, &mdt_body->fid1))
                         RETURN(-ESTALE);
         }
 
@@ -831,7 +831,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                 }
         }
         CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
-               op_data->namelen, op_data->name, ldlm_it2str(it->it_op),
+               op_data->op_namelen, op_data->op_name, ldlm_it2str(it->it_op),
                it->d.lustre.it_status, it->d.lustre.it_disposition, rc);
 
         RETURN(rc);
index 75f8d5a..e8bda7d 100644 (file)
@@ -81,10 +81,10 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 
         LASSERT(op_data != NULL);
 
-        size[REQ_REC_OFF + 1] = op_data->mod_capa1 ?
+        size[REQ_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
 
-        if (op_data->flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN))
+        if (op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN))
                 size[REQ_REC_OFF + 2] = sizeof(struct mdt_epoch);
 
         if (ealen > 0) {
@@ -98,17 +98,17 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
         if (req == NULL)
                 RETURN(-ENOMEM);
 
-        if (op_data->attr.ia_valid & ATTR_FROM_OPEN) {
+        if (op_data->op_attr.ia_valid & ATTR_FROM_OPEN) {
                 req->rq_request_portal = MDS_SETATTR_PORTAL; //XXX FIXME bug 249
                 rpc_lock = obd->u.cli.cl_setattr_lock;
         } else {
                 rpc_lock = obd->u.cli.cl_rpc_lock;
         }
 
-        if (op_data->attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
+        if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
                 CDEBUG(D_INODE, "setting mtime %lu, ctime %lu\n",
-                       LTIME_S(op_data->attr.ia_mtime),
-                       LTIME_S(op_data->attr.ia_ctime));
+                       LTIME_S(op_data->op_attr.ia_mtime),
+                       LTIME_S(op_data->op_attr.ia_ctime));
         mdc_setattr_pack(req, REQ_REC_OFF, op_data, ea, ealen, ea2, ea2len);
 
         size[REPLY_REC_OFF] = sizeof(struct mdt_body);
@@ -129,13 +129,13 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
 {
         int size[5] = { sizeof(struct ptlrpc_body),
                         sizeof(struct mdt_rec_create),
-                        0, op_data->namelen + 1 };
+                        0, op_data->op_namelen + 1 };
         struct obd_device *obd = exp->exp_obd;
         int level, bufcount = 4, rc;
         struct ptlrpc_request *req;
         ENTRY;
 
-        size[REQ_REC_OFF + 1] = op_data->mod_capa1 ?
+        size[REQ_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
         if (data && datalen) {
                 size[bufcount] = datalen;
@@ -178,13 +178,13 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
         struct ptlrpc_request *req = *request;
         int size[4] = { sizeof(struct ptlrpc_body),
                         sizeof(struct mdt_rec_unlink),
-                        0, op_data->namelen + 1 };
+                        0, op_data->op_namelen + 1 };
         int rc;
         ENTRY;
 
         LASSERT(req == NULL);
 
-        size[REQ_REC_OFF + 1] = op_data->mod_capa1 ?
+        size[REQ_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
 
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
@@ -213,13 +213,13 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
         struct ptlrpc_request *req;
         int size[5] = { sizeof(struct ptlrpc_body),
                         sizeof(struct mdt_rec_link),
-                        0, 0, op_data->namelen + 1 };
+                        0, 0, op_data->op_namelen + 1 };
         int rc;
         ENTRY;
 
-        size[REQ_REC_OFF + 1] = op_data->mod_capa1 ?
+        size[REQ_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
-        size[REQ_REC_OFF + 2] = op_data->mod_capa2 ?
+        size[REQ_REC_OFF + 2] = op_data->op_mod_capa2 ?
                                         sizeof(struct lustre_capa) : 0;
 
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
@@ -252,9 +252,9 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
         int rc;
         ENTRY;
 
-        size[REQ_REC_OFF + 1] = op_data->mod_capa1 ?
+        size[REQ_REC_OFF + 1] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
-        size[REQ_REC_OFF + 2] = op_data->mod_capa2 ?
+        size[REQ_REC_OFF + 2] = op_data->op_mod_capa2 ?
                                         sizeof(struct lustre_capa) : 0;
 
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
index e2767cc..ab4f17c 100644 (file)
@@ -803,7 +803,7 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
         int rc;
         ENTRY;
 
-        reqsize[REQ_REC_OFF + 2] = op_data->mod_capa1 ?
+        reqsize[REQ_REC_OFF + 2] = op_data->op_mod_capa1 ?
                                         sizeof(struct lustre_capa) : 0;
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
                               MDS_CLOSE, 4, reqsize, NULL);
@@ -892,7 +892,7 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
         int rc;
         ENTRY;
 
-        if (op_data->mod_capa1)
+        if (op_data->op_mod_capa1)
                 size[REQ_REC_OFF + 2] = sizeof(struct lustre_capa);
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
                               MDS_DONE_WRITING, 4, size, NULL);
index 07224e6..7aa872a 100644 (file)
@@ -194,7 +194,7 @@ int mdd_get_md(const struct lu_env *env, struct mdd_object *obj,
                                         mdd_buf_get(env, md, *md_size), name,
                                         mdd_object_capa(env, obj));
         /*
-         * XXX: handling of -ENODATA, the right way is to have ->do_md_get()
+         * XXX: Handling of -ENODATA, the right way is to have ->do_md_get()
          * exported by dt layer.
          */
         if (rc == 0 || rc == -ENODATA) {
@@ -203,12 +203,12 @@ int mdd_get_md(const struct lu_env *env, struct mdd_object *obj,
         } else if (rc < 0) {
                 CERROR("Error %d reading eadata \n", rc);
         } else {
-                /* XXX: convert lov EA but fixed after verification test. */
+                /* XXX: Convert lov EA but fixed after verification test. */
                 *md_size = rc;
         }
 
         mdd_lproc_time_end(mdd, &start, LPROC_MDD_GET_MD);
-        RETURN (rc);
+        RETURN(rc);
 }
 
 int mdd_get_md_locked(const struct lu_env *env, struct mdd_object *obj,
@@ -296,7 +296,7 @@ int mdd_lov_set_md(const struct lu_env *env, struct mdd_object *pobj,
                         rc = mdd_xattr_set_txn(env, child, buf,
                                                MDS_LOV_MD_NAME, 0, handle);
                 }
-        } else  if (S_ISDIR(mode)) {
+        } else if (S_ISDIR(mode)) {
                 if (lmmp == NULL && lmm_size == 0) {
                         struct lov_mds_md *lmm = &mdd_env_info(env)->mti_lmm;
                         int size = sizeof(*lmm);
@@ -487,9 +487,9 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
         }
 
         /*
-         * Sometimes, we may truncate some object(without lsm) then open (with
-         * write flags)it, so creating lsm above.  The Nonzero(truncated) size
-         * should tell ost. since size attr is in charged by OST.
+         * Sometimes, we may truncate some object(without lsm) then open it
+         * (with write flags), so creating lsm above.  The Nonzero(truncated)
+         * size should tell ost, since size attr is in charge by OST.
          */
         if (la->la_size && la->la_valid & LA_SIZE) {
                 struct obd_info *oinfo = &mdd_env_info(env)->mti_oi;
index 670b381..471e160 100644 (file)
@@ -77,12 +77,13 @@ static int mdd_procfs_init_stats(struct mdd_device *mdd, int num_stats)
                              LPROCFS_CNTR_AVGMINMAX, "get_md", "time");
         lprocfs_counter_init(mdd->mdd_stats, LPROC_MDD_LOOKUP,
                              LPROCFS_CNTR_AVGMINMAX, "lookup", "lookup");
+        EXIT;
 cleanup:
         if (rc) {
                 lprocfs_free_stats(stats);
                 mdd->mdd_stats = NULL;
         }
-        RETURN(rc);
+        return rc;
 }
 
 int mdd_procfs_fini(struct mdd_device *mdd)
index dbef285..4c40104 100644 (file)
@@ -824,7 +824,7 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
         if (rc != 0)
                 RETURN(rc);
 
-        /*step 2: lookup child's fid by name */
+        /* step 2: lookup child's fid by name */
         rc = mdo_lookup(info->mti_env, next, name, child_fid);
         if (rc != 0) {
                 if (rc == -ENOENT)
index 79336ec..eb7f37b 100644 (file)
@@ -233,18 +233,18 @@ enum {
 };
 
 struct mdt_reint_record {
-        mdt_reint_t          rr_opcode;
-        const struct lu_fid *rr_fid1;
-        const struct lu_fid *rr_fid2;
-        const char          *rr_name;
-        int                  rr_namelen;
-        const char          *rr_tgt;
-        int                  rr_tgtlen;
-        const void          *rr_eadata;
-        int                  rr_eadatalen;
-        int                  rr_logcookielen;
+        mdt_reint_t             rr_opcode;
+        const struct lu_fid    *rr_fid1;
+        const struct lu_fid    *rr_fid2;
+        const char             *rr_name;
+        int                     rr_namelen;
+        const char             *rr_tgt;
+        int                     rr_tgtlen;
+        const void             *rr_eadata;
+        int                     rr_eadatalen;
+        int                     rr_logcookielen;
         const struct llog_cookie  *rr_logcookies;
-        __u32                rr_flags;
+        __u32                   rr_flags;
 };
 
 enum mdt_reint_flag {
index d7dfb65..e03dfcf 100644 (file)
@@ -325,7 +325,7 @@ static int mdt_reint_create(struct mdt_thread_info *info,
         switch (info->mti_attr.ma_attr.la_mode & S_IFMT) {
         case S_IFDIR:{
                 /* Cross-ref case. */
-                if (info->mti_rr.rr_namelen == 1) {
+                if (info->mti_rr.rr_name[0] == 0) {
                         rc = mdt_md_mkobj(info);
                         break;
                 }
@@ -706,7 +706,7 @@ static int mdt_reint_rename(struct mdt_thread_info *info,
         int                      rc;
         ENTRY;
 
-        if (rr->rr_namelen == 1) {
+        if (rr->rr_name[0] == 0) {
                 rc = mdt_reint_rename_tgt(info);
                 RETURN(rc);
         }
index 9476e4d..7e77e0d 100644 (file)
@@ -214,15 +214,15 @@ EXPORT_SYMBOL(iattr_from_obdo);
 
 void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, obd_flag valid)
 {
-        iattr_from_obdo(&op_data->attr, oa, valid);
+        iattr_from_obdo(&op_data->op_attr, oa, valid);
         if (valid & OBD_MD_FLBLOCKS) {
-                op_data->attr_blocks = oa->o_blocks;
-                op_data->attr.ia_valid |= ATTR_BLOCKS;
+                op_data->op_attr_blocks = oa->o_blocks;
+                op_data->op_attr.ia_valid |= ATTR_BLOCKS;
         }
         if (valid & OBD_MD_FLFLAGS) {
-                ((struct ll_iattr *)&op_data->attr)->ia_attr_flags =
+                ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags =
                         oa->o_flags;
-                op_data->attr.ia_valid |= ATTR_ATTR_FLAG;
+                op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
         }
 }
 EXPORT_SYMBOL(md_from_obdo);
@@ -230,14 +230,14 @@ EXPORT_SYMBOL(md_from_obdo);
 void obdo_from_md(struct obdo *oa, struct md_op_data *op_data,
                   unsigned int valid)
 {
-        obdo_from_iattr(oa, &op_data->attr, valid);
+        obdo_from_iattr(oa, &op_data->op_attr, valid);
         if (valid & ATTR_BLOCKS) {
-                oa->o_blocks = op_data->attr_blocks;
+                oa->o_blocks = op_data->op_attr_blocks;
                 oa->o_valid |= OBD_MD_FLBLOCKS;
         }
         if (valid & ATTR_ATTR_FLAG) {
                 oa->o_flags = 
-                        ((struct ll_iattr *)&op_data->attr)->ia_attr_flags;
+                        ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;
                 oa->o_valid |= OBD_MD_FLFLAGS;
         }
 }
index 85ecd8d..b3ef7b4 100644 (file)
@@ -79,7 +79,7 @@ static int osc_interpret_create(struct ptlrpc_request *req, void *data, int rc)
                 oscc->oscc_grow_count = OST_MIN_PRECREATE;
                 spin_unlock(&oscc->oscc_lock);
                 DEBUG_REQ(D_ERROR, req,
-                          "unknown rc %d from async create: failing oscc", rc);
+                          "Unknown rc %d from async create: failing oscc", rc);
                 ptlrpc_fail_import(req->rq_import,
                                    lustre_msg_get_conn_cnt(req->rq_reqmsg));
         } else {
index a6a001e..4e2b17e 100644 (file)
@@ -74,7 +74,7 @@ int lgss_mech_register(struct gss_api_mech *gm)
         spin_lock(&registered_mechs_lock);
         list_add(&gm->gm_list, &registered_mechs);
         spin_unlock(&registered_mechs_lock);
-        CWARN("register %s mechanism\n", gm->gm_name);
+        CWARN("Register %s mechanism\n", gm->gm_name);
         return 0;
 }
 
@@ -83,7 +83,7 @@ void lgss_mech_unregister(struct gss_api_mech *gm)
         spin_lock(&registered_mechs_lock);
         list_del(&gm->gm_list);
         spin_unlock(&registered_mechs_lock);
-        CWARN("unregister %s mechanism\n", gm->gm_name);
+        CWARN("Unregister %s mechanism\n", gm->gm_name);
 }