int cmm_root_get(struct lu_context *ctx, struct md_device *m, struct lu_fid *f);
int cmm_statfs(struct lu_context *ctx,
struct md_device *m, struct kstatfs *sfs);
-int cmm_object_create(struct lu_context *, struct md_object *);
int cmm_mkdir(struct lu_context *ctxt, struct lu_attr*,
struct md_object *o, const char *name,
struct md_object *child);
}
/* Metadata API */
-int cmm_object_create(struct lu_context *ctx, struct md_object *mo)
+static int cmm_object_create(struct lu_context *ctx,
+ struct md_object *mo, struct lu_attr *attr)
{
struct cmm_object *cmo = md2cmm_obj(mo);
struct md_object *nxo = cmm2child_obj(cmo);
ENTRY;
LASSERT (cmm_is_local_obj(cmo));
-
- rc = nxo->mo_ops->moo_object_create(ctx, nxo);
-
+
+ rc = nxo->mo_ops->moo_object_create(ctx, nxo, attr);
+
RETURN(rc);
}
int cmm_mkdir(struct lu_context *ctx, struct lu_attr *attr,
struct cmm_object *cmm_c = md2cmm_obj(c);
struct md_object *local = cmm2child_obj(cmm_p);
int rc;
-
+
ENTRY;
if (cmm_is_local_obj(cmm_c)) {
struct md_object *remote = cmm2child_obj(cmm_c);
/* remote object creation and local name insert */
- rc = remote->mo_ops->moo_object_create(ctx, remote);
+ rc = remote->mo_ops->moo_object_create(ctx, remote, attr);
if (rc == 0) {
rc = local->mo_dir_ops->mdo_name_insert(ctx, local,
name, fid,
//struct mdc_device *d = lu2mdc_dev(o->lo_dev);
//struct lu_device *under;
//struct lu_fid *fid = &o->lo_header->loh_fid;
-
+
ENTRY;
RETURN(0);
return seq_printf(f, LUSTRE_MDC0_NAME"-object@%p", lo);
}
-static int mdc_object_create(struct lu_context *ctx, struct md_object *mo)
+static int mdc_object_create(struct lu_context *ctx, struct md_object *mo,
+ struct lu_attr *attr)
{
struct mdc_device *mc = md2mdc_dev(md_device_get(mo));
int rc;
*/
rec = lustre_msg_buf(req->rq_reqmsg, MDS_REQ_REC_OFF, sizeof (*rec));
rec->cr_opcode = REINT_CREATE;
- rec->cr_fsuid = 0;//uid;
- rec->cr_fsgid = 0;//gid;
+ rec->cr_fsuid = attr->la_uid;
+ rec->cr_fsgid = attr->la_gid;
rec->cr_cap = 0;//cap_effective;
rec->cr_fid1 = mo->mo_lu.lo_header->loh_fid;
memset(&rec->cr_fid2, 0, sizeof(rec->cr_fid2));
- rec->cr_mode = S_IFDIR;//mode;
+ rec->cr_mode = attr->la_mode;
rec->cr_rdev = 0;//rdev;
- rec->cr_time = 0;//op_data->mod_time;
+ rec->cr_time = attr->la_mtime; //op_data->mod_time;
rec->cr_suppgid = 0;//op_data->suppgids[0];
-
+
size = sizeof(struct mdt_body);
req->rq_replen = lustre_msg_size(1, &size);
lustre_swab_mdt_body)) {
CERROR ("Can't unpack mdt_body\n");
rc = -EPROTO;
- } else
+ } else
CDEBUG(D_INFO, "Done MDC req!\n");
RETURN(rc);
int (*moo_xattr_set)(struct lu_context *ctxt, struct md_object *obj,
void *buf, int buf_len, const char *name);
/* part of cross-ref operation */
- int (*moo_object_create)(struct lu_context *, struct md_object *);
+ int (*moo_object_create)(struct lu_context *,
+ struct md_object *, struct lu_attr *);
int (*moo_object_destroy)(struct lu_context *, struct md_object *);
};
lh->mlh_mode = LCK_PW;
parent = mdt_object_find_lock(info->mti_ctxt,
- mdt, info->mti_rr.rr_fid1,
- lh,
+ mdt, info->mti_rr.rr_fid1,
+ lh,
MDS_INODELOCK_UPDATE);
if (IS_ERR(parent))
return PTR_ERR(parent);
struct mdt_object *o;
struct mdt_lock_handle *lh;
int result;
-
+
ENTRY;
o = mdt_object_find(info->mti_ctxt, mdt, info->mti_rr.rr_fid1);
if (!IS_ERR(o)) {
struct md_object *next = mdt_object_child(o);
- result = next->mo_ops->moo_object_create(info->mti_ctxt, next);
- //&info->mti_attr,
+ result = next->mo_ops->moo_object_create(info->mti_ctxt, next,
+ &info->mti_attr);
mdt_object_put(info->mti_ctxt, o);
} else
result = PTR_ERR(o);