From 63111cc0c0664bc6ebcb4d2e35b018fa08f7aa45 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 14 Jul 2005 14:25:34 +0000 Subject: [PATCH] Revert Tom's commit. It breaks recovery. r=alex r=umka --- .../patches/vfs-wantedi-misc-2.6-suse.patch | 10 ++++------ lustre/mds/handler.c | 17 +++++++---------- lustre/mds/mds_fs.c | 6 ++---- lustre/mds/mds_internal.h | 4 ++-- lustre/mds/mds_open.c | 10 +++------- lustre/mds/mds_reint.c | 16 ++++++---------- lustre/smfs/mds_kml.c | 5 ----- 7 files changed, 24 insertions(+), 44 deletions(-) diff --git a/lustre/kernel_patches/patches/vfs-wantedi-misc-2.6-suse.patch b/lustre/kernel_patches/patches/vfs-wantedi-misc-2.6-suse.patch index f44b1586..0f52cf6 100644 --- a/lustre/kernel_patches/patches/vfs-wantedi-misc-2.6-suse.patch +++ b/lustre/kernel_patches/patches/vfs-wantedi-misc-2.6-suse.patch @@ -1,16 +1,14 @@ -Index: linux-2.6.10/include/linux/dcache.h +Index: uml-2.6.3/include/linux/dcache.h =================================================================== ---- linux-2.6.10.orig/include/linux/dcache.h 2005-07-11 17:33:07.000000000 +0800 -+++ linux-2.6.10/include/linux/dcache.h 2005-07-14 20:27:46.000000000 +0800 -@@ -24,6 +24,13 @@ +--- uml-2.6.3.orig/include/linux/dcache.h 2004-02-21 00:19:14.365988600 +0800 ++++ uml-2.6.3/include/linux/dcache.h 2004-02-21 00:21:04.612228624 +0800 +@@ -25,6 +25,11 @@ #define IS_ROOT(x) ((x) == (x)->d_parent) +struct dentry_params { + unsigned long p_inum; + void *p_ptr; -+ __u64 p_fid; -+ __u64 p_group; +}; + /* diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 2c205ab..16d09e8 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2281,7 +2281,6 @@ static int mdt_obj_create(struct ptlrpc_request *req) struct mea *mea; void *handle = NULL; unsigned long cr_inum = 0; - __u64 fid = 0; ENTRY; DEBUG_REQ(D_HA, req, "create remote object"); @@ -2393,13 +2392,10 @@ repeat: CERROR("%s: name exists. repeat\n", obd->obd_name); goto repeat; } - - fid = mds_alloc_fid(obd); + new->d_fsdata = (void *)&dp; dp.p_inum = 0; dp.p_ptr = req; - dp.p_fid = fid; - dp.p_group = mds->mds_num; if ((lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) || (body->oa.o_flags & OBD_FL_RECREATE_OBJS)) { @@ -2475,7 +2471,7 @@ repeat: * and this is not replay. */ down(&new->d_inode->i_sem); - rc = mds_set_inode_sid(obd, new->d_inode, handle, &id, fid); + rc = mds_alloc_inode_sid(obd, new->d_inode, handle, &id); up(&new->d_inode->i_sem); } if (rc) { @@ -3262,11 +3258,12 @@ __u64 mds_alloc_fid(struct obd_device *obd) return fid; } + /* - * update new lustre_id on passed @inode and saves it to inode EA. + * allocates new lustre_id on passed @inode and saves it to inode EA. */ -int mds_set_inode_sid(struct obd_device *obd, struct inode *inode, - void *handle, struct lustre_id *id, __u64 fid) +int mds_alloc_inode_sid(struct obd_device *obd, struct inode *inode, + void *handle, struct lustre_id *id) { struct mds_obd *mds = &obd->u.mds; int alloc = 0, rc = 0; @@ -3283,7 +3280,7 @@ int mds_set_inode_sid(struct obd_device *obd, struct inode *inode, } id_group(id) = mds->mds_num; - id_fid(id) = fid; + id_fid(id) = mds_alloc_fid(obd); id_ino(id) = inode->i_ino; id_gen(id) = inode->i_generation; id_type(id) = (S_IFMT & inode->i_mode); diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 811e838..0785828 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -460,7 +460,6 @@ int mds_fs_setup_rootid(struct obd_device *obd) struct inode *inode; struct dentry *dentry; struct mds_obd *mds = &obd->u.mds; - __u64 fid; ENTRY; /* getting root directory and setup its fid. */ @@ -499,13 +498,12 @@ int mds_fs_setup_rootid(struct obd_device *obd) GOTO(out_dentry, rc); } - fid = mds_alloc_fid(obd); down(&inode->i_sem); - rc = mds_set_inode_sid(obd, inode, handle, &mds->mds_rootid, fid); + rc = mds_alloc_inode_sid(obd, inode, handle, &mds->mds_rootid); up(&inode->i_sem); if (rc) { - CERROR("mds_set_inode_sid() failed, rc = %d\n", + CERROR("mds_alloc_inode_sid() failed, rc = %d\n", rc); GOTO(out_dentry, rc); } diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index 5948655..aa0d14e 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -205,8 +205,8 @@ int mds_fs_setup_virtid(struct obd_device *obd); __u64 mds_alloc_fid(struct obd_device *obd); -int mds_set_inode_sid(struct obd_device *, struct inode *, - void *, struct lustre_id *, __u64 fid); +int mds_alloc_inode_sid(struct obd_device *, struct inode *, + void *, struct lustre_id *); int mds_update_inode_sid(struct obd_device *, struct inode *, void *, struct lustre_id *); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 82e21b7..deff801 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -914,7 +914,6 @@ int mds_open(struct mds_update_record *rec, int offset, struct mea *mea = NULL; int mea_size, update_mode; int child_mode = LCK_PR; - __u64 fid = 0; ENTRY; DEBUG_REQ(D_INODE, req, "parent "DLID4" name %*s mode %o", @@ -1148,12 +1147,9 @@ got_child: handle = NULL; GOTO(cleanup, rc); } - fid = mds_alloc_fid(obd); dchild->d_fsdata = (void *) &dp; dp.p_ptr = req; dp.p_inum = ino; - dp.p_fid = fid; - dp.p_group = mds->mds_num; rc = ll_vfs_create(dparent->d_inode, dchild, rec->ur_mode, NULL); if (dchild->d_fsdata == (void *)(unsigned long)ino) @@ -1214,10 +1210,10 @@ got_child: */ mds_set_last_fid(obd, id_fid(rec->ur_id2)); } else { - rc = mds_set_inode_sid(obd, dchild->d_inode, - handle, &body->id1, fid); + rc = mds_alloc_inode_sid(obd, dchild->d_inode, + handle, &body->id1); if (rc) { - CERROR("mds_set_inode_sid() failed, " + CERROR("mds_alloc_inode_sid() failed, " "rc = %d\n", rc); } } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 64459bf..c69d9e5 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -693,7 +693,6 @@ static int mds_reint_create(struct mds_update_record *rec, int offset, struct dentry_params dp; struct mea *mea = NULL; int mea_size; - __u64 fid; ENTRY; LASSERT(offset == 1); @@ -782,12 +781,9 @@ static int mds_reint_create(struct mds_update_record *rec, int offset, * needed to check if object already created in the case of creating * remote inode. */ - fid = mds_alloc_fid(obd); dchild->d_fsdata = (void *)&dp; dp.p_inum = (unsigned long)id_ino(rec->ur_id2); dp.p_ptr = req; - dp.p_fid = fid; - dp.p_group = mds->mds_num; switch (type) { case S_IFREG: { @@ -846,10 +842,10 @@ static int mds_reint_create(struct mds_update_record *rec, int offset, */ mds_set_last_fid(obd, id_fid(rec->ur_id2)); } else { - rc = mds_set_inode_sid(obd, dchild->d_inode, - handle, NULL, fid); + rc = mds_alloc_inode_sid(obd, dchild->d_inode, + handle, NULL); if (rc) { - CERROR("mds_set_inode_sid() failed, inode %lu, " + CERROR("mds_alloc_inode_sid() failed, inode %lu, " "rc %d\n", dchild->d_inode->i_ino, rc); } } @@ -1083,11 +1079,11 @@ static int mds_reint_create(struct mds_update_record *rec, int offset, * because for dir it was already done. */ down(&inode->i_sem); - rc = mds_set_inode_sid(obd, inode, - handle, NULL, fid); + rc = mds_alloc_inode_sid(obd, inode, + handle, NULL); up(&inode->i_sem); if (rc) { - CERROR("mds_set_inode_sid() failed, " + CERROR("mds_alloc_inode_sid() failed, " "inode %lu, rc %d\n", inode->i_ino, rc); } diff --git a/lustre/smfs/mds_kml.c b/lustre/smfs/mds_kml.c index 54ad1ad..d62350d 100644 --- a/lustre/smfs/mds_kml.c +++ b/lustre/smfs/mds_kml.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -135,8 +134,6 @@ static int mds_rec_create_pack(char *buffer, struct dentry *dentry, struct lustre_msg *msg = NULL; struct mdc_op_data *op_data; struct mds_rec_create *rec; - struct dentry_params *param = - (struct dentry_params *) dentry->d_fsdata; int rc = 0, tgt_len = 0; void *tmp = NULL; @@ -150,8 +147,6 @@ static int mds_rec_create_pack(char *buffer, struct dentry *dentry, (char *)dentry->d_name.name, dentry->d_name.len, 0); - id_fid(&op_data->id1) = param->p_fid; - id_group(&op_data->id1) = param->p_group; PACK_KML_REC_INIT(buffer, MDS_REINT); mkpi = (struct mds_kml_pack_info *)buffer; -- 1.8.3.1