- use name[0] == 0 to check if this is partial operation.
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;
struct mdc_thread_info {
struct md_op_data mci_opdata;
- struct ptlrpc_request *mci_req;
+ struct ptlrpc_request *mci_req;
};
struct mdc_object {
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;
}
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);
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;
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;
}
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 */
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;
}
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);
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,
#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 */
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)
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)
}
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);
&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) {
.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();
* 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);
/* 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);
* 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);
}
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 } } };
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);
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);
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);
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);
.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);
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;
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,
{
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);
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);
}
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);
}
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;
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;
* 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);
}
* 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);
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);
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");
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);
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);
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);
}
.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);
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;
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);
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);
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);
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;
}
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);
{
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;
* 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);
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);
* 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;
}
* 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) &&
{
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;
/* 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
* 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;
}
#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);
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,
*/
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);
}
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))
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;
/*
* 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);
}
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);
* 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.
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");
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)
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);
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)
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);
}
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,
* 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;
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));
{
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;
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));
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;
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,
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;
* 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,
}
/*
- * 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)
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);
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)
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);
* 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
*/
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
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);
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)) {
}
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));
{
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;
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));
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);
}
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);
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;
}
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);
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,
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);
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,
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,
/* 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);
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);
}
}
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);
}
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;
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
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);
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;
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;
/* 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);
}
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
/* 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);
}
}
}
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);
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) {
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);
{
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;
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,
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,
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,
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);
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);
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) {
} 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,
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);
}
/*
- * 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;
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)
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)
};
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 {
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;
}
int rc;
ENTRY;
- if (rr->rr_namelen == 1) {
+ if (rr->rr_name[0] == 0) {
rc = mdt_reint_rename_tgt(info);
RETURN(rc);
}
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);
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;
}
}
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 {
spin_lock(®istered_mechs_lock);
list_add(&gm->gm_list, ®istered_mechs);
spin_unlock(®istered_mechs_lock);
- CWARN("register %s mechanism\n", gm->gm_name);
+ CWARN("Register %s mechanism\n", gm->gm_name);
return 0;
}
spin_lock(®istered_mechs_lock);
list_del(&gm->gm_list);
spin_unlock(®istered_mechs_lock);
- CWARN("unregister %s mechanism\n", gm->gm_name);
+ CWARN("Unregister %s mechanism\n", gm->gm_name);
}