From: tappro Date: Thu, 4 May 2006 19:34:56 +0000 (+0000) Subject: rename fid,replayfid in mdt_rec_create to the fid1,fid2 and use fid2 properly X-Git-Tag: v1_8_0_110~486^2~1879 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ba8ca77120b84552128893e16c18065ce1db8644;p=fs%2Flustre-release.git rename fid,replayfid in mdt_rec_create to the fid1,fid2 and use fid2 properly --- diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 8bc076e..a97815c 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -978,8 +978,8 @@ struct mdt_rec_create { __u32 cr_cap; __u32 cr_flags; /* for use with open */ __u32 cr_mode; - struct lu_fid cr_fid; - struct lu_fid cr_replayfid; + struct lu_fid cr_fid1; + struct lu_fid cr_fid2; __u64 cr_time; __u64 cr_rdev; __u32 cr_suppgid; diff --git a/lustre/mdc/mdc_lib.c b/lustre/mdc/mdc_lib.c index d939bc3..fef2e36 100644 --- a/lustre/mdc/mdc_lib.c +++ b/lustre/mdc/mdc_lib.c @@ -88,8 +88,8 @@ 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_fid = op_data->fid1; - memset(&rec->cr_replayfid, 0, sizeof(rec->cr_replayfid)); + rec->cr_fid1 = op_data->fid1; + rec->cr_fid2 = op_data->fid2; rec->cr_mode = mode; rec->cr_rdev = rdev; rec->cr_time = op_data->mod_time; @@ -148,9 +148,10 @@ void mdc_open_pack(struct ptlrpc_request *req, int offset, rec->cr_fsuid = current->fsuid; rec->cr_fsgid = current->fsgid; rec->cr_cap = current->cap_effective; - if (op_data != NULL) - rec->cr_fid = op_data->fid1; - memset(&rec->cr_replayfid, 0, sizeof(rec->cr_replayfid)); + if (op_data != NULL) { + rec->cr_fid1 = op_data->fid1; + rec->cr_fid2 = op_data->fid2; + } rec->cr_mode = mode; rec->cr_flags = mds_pack_open_flags(flags); rec->cr_rdev = rdev; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index dc9ad43..6978cc6 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -533,7 +533,7 @@ int mdc_set_open_replay_data(struct obd_export *exp, mod->mod_och = och; mod->mod_open_req = open_req; - memcpy(&rec->cr_replayfid, &body->fid1, sizeof rec->cr_replayfid); + rec->cr_fid2 = body->fid1; open_req->rq_replay_cb = mdc_replay_open; open_req->rq_commit_cb = mdc_commit_open; open_req->rq_cb_data = mod; @@ -1084,6 +1084,7 @@ static int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid, LASSERT(fid != NULL); LASSERT(hint != NULL); + LASSERT(fid_seq(&cli->cl_fid)); spin_lock(&cli->cl_fid_lock); if (fid_oid(&cli->cl_fid) < LUSTRE_FID_SEQ_WIDTH) { diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 83dbfc6..0f3415c 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -64,8 +64,8 @@ static int mdt_create_unpack(struct mdt_thread_info *info, if (rec == NULL) RETURN(-EFAULT); - rr->rr_fid1 = &rec->cr_fid; - rr->rr_fid2 = &rec->cr_replayfid; + rr->rr_fid1 = &rec->cr_fid1; + rr->rr_fid2 = &rec->cr_fid2; attr->la_mode = rec->cr_mode; rr->rr_name = lustre_msg_string(req->rq_reqmsg, offset + 1, 0); diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 6fbbc5e..c732389 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1284,7 +1284,7 @@ static int mgs_write_log_mds(struct obd_device *obd, struct fs_db *fsdb, //for_all_existing_mdt except current one for (i = 0; i < INDEX_MAP_SIZE * 8; i++){ char *mdtname; - if (i != mti->mti_stripe_index && + if (i != mti->mti_stripe_index && test_bit(i, fsdb->fsdb_mdt_index_map)) { sprintf(mdt_index,"-MDT%04x",i); diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index b5e4cbb..22be02c 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -793,8 +793,8 @@ void lustre_swab_mdt_rec_create (struct mdt_rec_create *cr) __swab32s (&cr->cr_cap); __swab32s (&cr->cr_flags); /* for use with open */ __swab32s (&cr->cr_mode); - lustre_swab_lu_fid (&cr->cr_fid); - lustre_swab_lu_fid (&cr->cr_replayfid); + lustre_swab_lu_fid (&cr->cr_fid1); + lustre_swab_lu_fid (&cr->cr_fid2); __swab64s (&cr->cr_time); __swab64s (&cr->cr_rdev); __swab32s (&cr->cr_suppgid);