struct orph_key mti_orph_key;
struct obd_trans_info mti_oti;
struct lu_buf mti_buf;
+ struct obdo mti_oa;
char mti_xattr_buf[LUSTRE_POSIX_ACL_MAX_SIZE];
};
const int needacl);
int mdd_object_kill(const struct lu_env *env, struct mdd_object *obj,
struct md_attr *ma);
-int mdd_iattr_get(const struct lu_env *env, struct mdd_object *mdd_obj,
+int mdd_iattr_get(const struct lu_env *env, struct mdd_object *mdd_obj,
struct md_attr *ma);
int mdd_attr_get_internal_locked(const struct lu_env *env,
- struct mdd_object *mdd_obj,
+ struct mdd_object *mdd_obj,
struct md_attr *ma);
int mdd_object_create_internal(const struct lu_env *env,
struct mdd_object *obj, struct md_attr *ma,
/* mdd_dir.c */
int mdd_unlink_sanity_check(const struct lu_env *env, struct mdd_object *pobj,
struct mdd_object *cobj, struct md_attr *ma);
-int mdd_finish_unlink(const struct lu_env *env, struct mdd_object *obj,
+int mdd_finish_unlink(const struct lu_env *env, struct mdd_object *obj,
struct md_attr *ma, struct thandle *th);
int mdd_object_initialize(const struct lu_env *env, const struct lu_fid *pfid,
- struct mdd_object *child, struct md_attr *ma,
+ struct mdd_object *child, struct md_attr *ma,
struct thandle *handle);
int mdd_link_sanity_check(const struct lu_env *env, struct mdd_object *tgt_obj,
struct mdd_object *src_obj);
int mdd_procfs_init(struct mdd_device *mdd);
int mdd_procfs_fini(struct mdd_device *mdd);
-void mdd_lproc_time_start(struct mdd_device *mdd, struct timeval *start,
+void mdd_lproc_time_start(struct mdd_device *mdd, struct timeval *start,
int op);
void mdd_lproc_time_end(struct mdd_device *mdd, struct timeval *start, int op);
}
int mdd_in_group_p(struct md_ucred *uc, gid_t grp);
-int mdd_acl_def_get(const struct lu_env *env, struct mdd_object *mdd_obj,
+int mdd_acl_def_get(const struct lu_env *env, struct mdd_object *mdd_obj,
struct md_attr *ma);
-int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
+int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
struct thandle *handle);
int __mdd_acl_init(const struct lu_env *env, struct mdd_object *obj,
struct lu_buf *buf, __u32 *mode, struct thandle *handle);
struct mdd_object *cobj, __u32 *mode, struct thandle *handle);
int __mdd_permission_internal(const struct lu_env *env, struct mdd_object *obj,
int mask, int getattr);
-int mdd_permission_internal(const struct lu_env *env, struct mdd_object *obj,
+int mdd_permission_internal(const struct lu_env *env, struct mdd_object *obj,
int mask);
int mdd_permission(const struct lu_env *env, struct md_object *obj, int mask);
int mdd_capa_get(const struct lu_env *env, struct md_object *obj,
upcall_dev = mdd->mdd_md_dev.md_upcall.mu_upcall_dev;
rc = upcall_dev->md_upcall.mu_upcall(NULL, upcall_dev, MD_LOV_SYNC);
-
+
RETURN(rc);
}
struct timeval start;
int rc;
ENTRY;
-
+
mdd_lproc_time_start(mdd, &start, LPROC_MDD_GET_MD);
next = mdd_object_child(obj);
rc = next->do_ops->do_xattr_get(env, next,
/* FIXME convert lov EA but fixed after verification test */
*md_size = rc;
}
-
+
mdd_lproc_time_end(mdd, &start, LPROC_MDD_GET_MD);
RETURN (rc);
}
struct mdd_object *child, struct lov_mds_md *lmmp,
int lmm_size, struct thandle *handle, int set_stripe)
{
- struct mdd_device *mdd = mdo2mdd(&child->mod_obj);
+ struct mdd_device *mdd = mdo2mdd(&child->mod_obj);
struct timeval start;
struct lu_buf *buf;
umode_t mode;
int rc = 0;
ENTRY;
-
+
mdd_lproc_time_start(mdd, &start, LPROC_MDD_SET_MD);
buf = mdd_buf_get(env, lmmp, lmm_size);
mode = mdd_object_type(child);
if (create_flags & MDS_OPEN_DELAY_CREATE ||
!(create_flags & FMODE_WRITE))
RETURN(0);
-
+
mdd_lproc_time_start(mdd, &start, LPROC_MDD_LOV_CREATE);
oti_init(oti, NULL);
GOTO(out_ids, rc = -ENOMEM);
LASSERT(lov_exp != NULL);
- oa = obdo_alloc();
- if (oa == NULL)
- GOTO(out_ids, rc = -ENOMEM);
+ oa = &mdd_env_info(env)->mti_oa;
oa->o_uid = 0; /* must have 0 uid / gid on OST */
oa->o_gid = 0;
rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, lov_exp,
0, &lsm, (void*)eadata);
if (rc)
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
lsm->lsm_object_id = oa->o_id;
lsm->lsm_object_gr = oa->o_gr;
} else if (parent != NULL) {
/* get lov ea from parent and set to lov */
struct lov_mds_md *__lmm;
int __lmm_size, returned_lmm_size;
-
+
__lmm_size = mdd_lov_mdsize(env, mdd);
returned_lmm_size = __lmm_size;
OBD_ALLOC(__lmm, __lmm_size);
if (__lmm == NULL)
- GOTO(out_oa, rc = -ENOMEM);
+ GOTO(out_oti, rc = -ENOMEM);
rc = mdd_get_md_locked(env, parent, __lmm,
&returned_lmm_size,
lov_exp, 0, &lsm, __lmm);
OBD_FREE(__lmm, __lmm_size);
if (rc)
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
}
rc = obd_create(lov_exp, oa, &lsm, oti);
PFID(mdo2fid(child)), rc);
rc = -EIO;
}
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
}
LASSERT(lsm->lsm_object_gr >= FILTER_GROUP_MDS0);
} else {
rc = obd_iocontrol(OBD_IOC_LOV_SETEA, lov_exp, 0, &lsm,
(void*)eadata);
if (rc)
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
lsm->lsm_object_id = oa->o_id;
lsm->lsm_object_gr = oa->o_gr;
}
-
+
/*
* Sometimes, we may truncate some object(without lsm) then open (with
* write flags)it, so creating lsm above. The Nonzero(truncated) size
memset(oinfo, 0, sizeof(*oinfo));
oa->o_size = la->la_size;
-
+
/* When setting attr to ost, FLBKSZ is not needed. */
oa->o_valid &= ~OBD_MD_FLBLKSZ;
obdo_from_la(oa, la, OBD_MD_FLTYPE | OBD_MD_FLATIME |
PFID(mdo2fid(child)), rc);
rc = -EIO;
}
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
}
}
-
+
/* blksize should be changed after create data object */
la->la_valid |= LA_BLKSIZE;
la->la_blksize = oa->o_blksize;
rc = obd_packmd(lov_exp, lmm, lsm);
if (rc < 0) {
CERROR("cannot pack lsm, err = %d\n", rc);
- GOTO(out_oa, rc);
+ GOTO(out_oti, rc);
}
*lmm_size = rc;
rc = 0;
EXIT;
-out_oa:
+out_oti:
oti_free_cookies(oti);
- obdo_free(oa);
out_ids:
if (lsm)
obd_free_memmd(lov_exp, &lsm);
if (rc != 0)
mdd_lov_objid_free(env, mdd);
-
+
mdd_lproc_time_end(mdd, &start, LPROC_MDD_LOV_CREATE);
return rc;
}
{
struct obd_device *obd = mdd2obd_dev(mdd);
struct timeval start;
-
+
mdd_lproc_time_start(mdd, &start, LPROC_MDD_UNLINK_LOG);
LASSERT(ma->ma_valid & MA_LOV);