Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
69d00d3
)
- cleanups about lmv_obd_create().
author
yury
<yury>
Fri, 12 Nov 2004 13:34:02 +0000
(13:34 +0000)
committer
yury
<yury>
Fri, 12 Nov 2004 13:34:02 +0000
(13:34 +0000)
lustre/include/linux/obd_class.h
patch
|
blob
|
history
lustre/lmv/lmv_obd.c
patch
|
blob
|
history
lustre/mdc/mdc_request.c
patch
|
blob
|
history
lustre/mds/mds_lmv.c
patch
|
blob
|
history
lustre/mds/mds_reint.c
patch
|
blob
|
history
diff --git
a/lustre/include/linux/obd_class.h
b/lustre/include/linux/obd_class.h
index
726c4bd
..
c4c0a19
100644
(file)
--- a/
lustre/include/linux/obd_class.h
+++ b/
lustre/include/linux/obd_class.h
@@
-1515,8
+1515,8
@@
static inline struct obdo *obdo_alloc(void)
{
struct obdo *oa;
- OBD_SLAB_ALLOC(oa, obdo_cachep, GFP_KERNEL,
sizeof(*oa));
-
+ OBD_SLAB_ALLOC(oa, obdo_cachep, GFP_KERNEL,
+ sizeof(*oa));
return oa;
}
@@
-1527,6
+1527,26
@@
static inline void obdo_free(struct obdo *oa)
OBD_SLAB_FREE(oa, obdo_cachep, sizeof(*oa));
}
+static inline void obdo2id(struct lustre_id *id,
+ struct obdo *oa)
+{
+ LASSERT(oa && id);
+ id_ino(id) = oa->o_id;
+ id_fid(id) = oa->o_fid;
+ id_group(id) = oa->o_mds;
+ id_gen(id) = oa->o_generation;
+}
+
+static inline void id2obdo(struct obdo *oa,
+ struct lustre_id *id)
+{
+ LASSERT(oa && id);
+ oa->o_id = id_ino(id);
+ oa->o_fid = id_fid(id);
+ oa->o_mds = id_group(id);
+ oa->o_generation = id_gen(id);
+}
+
#if !defined(__KERNEL__) || (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#define to_kdev_t(dev) dev
#define kdev_t_to_nr(dev) dev
diff --git
a/lustre/lmv/lmv_obd.c
b/lustre/lmv/lmv_obd.c
index
c56184d
..
74af9f2
100644
(file)
--- a/
lustre/lmv/lmv_obd.c
+++ b/
lustre/lmv/lmv_obd.c
@@
-1591,7
+1591,8
@@
int lmv_getready(struct obd_export *exp)
}
/*
- * to be called from MDS only.
+ * to be called from MDS only. @oa should have correct store cookie and o_fid
+ * values for "master" object, as it will be used.
*/
int lmv_obd_create(struct obd_export *exp, struct obdo *oa,
struct lov_stripe_md **ea, struct obd_trans_info *oti)
@@
-1601,7
+1602,6
@@
int lmv_obd_create(struct obd_export *exp, struct obdo *oa,
struct lustre_id mid;
int i, c, rc = 0;
struct mea *mea;
- int lcount;
ENTRY;
rc = lmv_check_connect(obd);
@@
-1623,44
+1623,46
@@
int lmv_obd_create(struct obd_export *exp, struct obdo *oa,
CERROR("obd_alloc_diskmd() failed, error %d\n",
rc);
RETURN(rc);
- }
+ } else
+ rc = 0;
if (*ea == NULL)
RETURN(-ENOMEM);
}
- rc = 0;
-
+ /*
+ * here we should take care about splitted dir, so store cookie and fid
+ * for "master" object should already be allocated and passed in @oa.
+ */
LASSERT(oa->o_id != 0);
- id_ino(&mid) = oa->o_id;
- id_fid(&mid) = oa->o_fid;
- id_gen(&mid) = oa->o_generation;
+ LASSERT(oa->o_fid != 0);
+
+ /* save "master" object id */
+ obdo2id(&mid, oa);
mea = (struct mea *)*ea;
- if (!mea->mea_count || mea->mea_count > lmv->desc.ld_tgt_count)
- mea->mea_count = lmv->desc.ld_tgt_count;
-
mea->mea_master = -1;
mea->mea_magic = MEA_MAGIC_ALL_CHARS;
- lcount = lmv->desc.ld_tgt_count;
- for (i = 0, c = 0; c < mea->mea_count && i < lcount; i++) {
+ if (!mea->mea_count || mea->mea_count > lmv->desc.ld_tgt_count)
+ mea->mea_count = lmv->desc.ld_tgt_count;
+
+ for (i = 0, c = 0; c < mea->mea_count && i < lmv->desc.ld_tgt_count; i++) {
struct lov_stripe_md obj_md;
struct lov_stripe_md *obj_mdp = &obj_md;
if (lmv->tgts[i].ltd_exp == NULL) {
- /* this is
master
MDS */
+ /* this is
"master"
MDS */
mea->mea_master = i;
- id_group(&mea->mea_ids[c]) = i;
- id_ino(&mea->mea_ids[c]) = id_ino(&mid);
- id_gen(&mea->mea_ids[c]) = id_gen(&mid);
- id_fid(&mea->mea_ids[c]) = id_fid(&mid);
+ mea->mea_ids[c] = mid;
c++;
continue;
}
- /* "master" MDS should always be part of stripped dir, so scan
- * for it. */
+ /*
+ * "master" MDS should always be part of stripped dir,
+ * so scan for it.
+ */
if (mea->mea_master == -1 && c == mea->mea_count - 1)
continue;
@@
-1677,19
+1679,28
@@
int lmv_obd_create(struct obd_export *exp, struct obdo *oa,
CDEBUG(D_OTHER, "dirobj at mds %d: "LPU64"/%u\n",
i, oa->o_id, oa->o_generation);
- /* here after object is created on desired MDS we save its fid
- * to local mea_ids. */
+
+ /*
+ * here, when object is created (or it is master and was passed
+ * from caller) on desired MDS we save its fid to local mea_ids.
+ */
LASSERT(oa->o_fid);
-
- id_group(&mea->mea_ids[c]) = i;
- id_ino(&mea->mea_ids[c]) = oa->o_id;
- id_fid(&mea->mea_ids[c]) = oa->o_fid;
- id_gen(&mea->mea_ids[c]) = oa->o_generation;
+
+ /*
+ * store cookie should be defined here for both cases (master
+ * object and not master), because master is already created.
+ */
+ LASSERT(oa->o_id);
+
+ /* fill mea by store cookie and fid */
+ obdo2id(&mea->mea_ids[c], oa);
c++;
}
LASSERT(c == mea->mea_count);
- CDEBUG(D_OTHER, "%d dirobjects created\n", (int) mea->mea_count);
+ CDEBUG(D_OTHER, "%d dirobjects created\n",
+ (int)mea->mea_count);
+
RETURN(rc);
}
diff --git
a/lustre/mdc/mdc_request.c
b/lustre/mdc/mdc_request.c
index
95ca070
..
cc46483
100644
(file)
--- a/
lustre/mdc/mdc_request.c
+++ b/
lustre/mdc/mdc_request.c
@@
-66,7
+66,10
@@
void mdc_pack_secdesc(struct ptlrpc_request *req, int size)
{
#ifdef __KERNEL__
struct mds_req_sec_desc *rsd;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
struct group_info *ginfo;
+#endif
rsd = lustre_msg_buf(req->rq_reqmsg,
MDS_REQ_SECDESC_OFF, size);
diff --git
a/lustre/mds/mds_lmv.c
b/lustre/mds/mds_lmv.c
index
a1ba735
..
c34b336
100644
(file)
--- a/
lustre/mds/mds_lmv.c
+++ b/
lustre/mds/mds_lmv.c
@@
-673,6
+673,7
@@
int mds_try_to_split_dir(struct obd_device *obd, struct dentry *dentry,
GOTO(err_oa, rc);
}
oa->o_fid = id_fid(&id);
+ oa->o_mds = mds->mds_num;
CDEBUG(D_OTHER, "%s: create subdirs with mode %o, uid %u, gid %u\n",
obd->obd_name, dir->i_mode, dir->i_uid, dir->i_gid);
diff --git
a/lustre/mds/mds_reint.c
b/lustre/mds/mds_reint.c
index
2baa1c8
..
498167b
100644
(file)
--- a/
lustre/mds/mds_reint.c
+++ b/
lustre/mds/mds_reint.c
@@
-837,10
+837,7
@@
static int mds_reint_create(struct mds_update_record *rec, int offset,
body->valid |= OBD_MD_FLID | OBD_MD_MDS |
OBD_MD_FID;
- id_group(&body->id1) = i;
- id_ino(&body->id1) = oa->o_id;
- id_fid(&body->id1) = oa->o_fid;
- id_gen(&body->id1) = oa->o_generation;
+ obdo2id(&body->id1, oa);
obdo_free(oa);
} else {
/* requested name exists in the directory */