From b4b1603c32a61248276d025c166c8c4f41a0327c Mon Sep 17 00:00:00 2001 From: wangdi Date: Mon, 16 Jul 2012 10:27:56 -0700 Subject: [PATCH] LU-1632 fid: remove fid_delete in delete_inode procedure Remove fid_delete in delete_inode procedure, which is completely obsolete in 2.x infrastructure , especially when lmv layer is not being created during upgrade, because it will cause the client fid space to be zero out whenever an inode is being deleted. Signed-off-by: Wang Di Change-Id: I07a59da0db2ac284eb99f78a24b0e1af3080e2ca Reviewed-on: http://review.whamcloud.com/3422 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/include/obd.h | 6 ------ lustre/include/obd_class.h | 13 ------------- lustre/llite/llite_lib.c | 6 ------ lustre/lmv/lmv_obd.c | 12 ------------ lustre/mdc/mdc_request.c | 11 ----------- lustre/obdclass/lprocfs_status.c | 1 - 6 files changed, 49 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 041cf3a..2c4fda2 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -1304,12 +1304,6 @@ struct obd_ops { int (*o_fid_alloc)(struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data); - /* - * Object with @fid is getting deleted, we may want to do something - * about this. - */ - int (*o_fid_delete)(struct obd_export *exp, const struct lu_fid *fid); - int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs, __u64 max_age, __u32 flags); int (*o_statfs_async)(struct obd_device *obd, struct obd_info *oinfo, diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index c93984b..c8b1031 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1041,19 +1041,6 @@ static inline int obd_fid_alloc(struct obd_export *exp, RETURN(rc); } -static inline int obd_fid_delete(struct obd_export *exp, - const struct lu_fid *fid) -{ - int rc; - ENTRY; - - EXP_CHECK_DT_OP(exp, fid_delete); - EXP_COUNTER_INCREMENT(exp, fid_delete); - - rc = OBP(exp->exp_obd, fid_delete)(exp, fid); - RETURN(rc); -} - static inline int obd_ping(struct obd_export *exp) { int rc; diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index b4dac6c..275a7bc 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1786,14 +1786,8 @@ void ll_read_inode2(struct inode *inode, void *opaque) void ll_delete_inode(struct inode *inode) { - struct ll_sb_info *sbi = ll_i2sbi(inode); - int rc; ENTRY; - rc = obd_fid_delete(sbi->ll_md_exp, ll_inode2fid(inode)); - if (rc) - CERROR("fid_delete() failed, rc %d\n", rc); - truncate_inode_pages(&inode->i_data, 0); /* Workaround for LU-118 */ diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 09167d6..3f9575b 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1040,17 +1040,6 @@ int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid, RETURN(rc); } -static int lmv_fid_delete(struct obd_export *exp, const struct lu_fid *fid) -{ - ENTRY; - LASSERT(exp != NULL && fid != NULL); - if (lmv_object_delete(exp, fid)) { - CDEBUG(D_INODE, "Object "DFID" is destroyed.\n", - PFID(fid)); - } - RETURN(0); -} - static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg) { struct lmv_obd *lmv = &obd->u.lmv; @@ -3129,7 +3118,6 @@ struct obd_ops lmv_obd_ops = { .o_notify = lmv_notify, .o_get_uuid = lmv_get_uuid, .o_iocontrol = lmv_iocontrol, - .o_fid_delete = lmv_fid_delete }; struct md_ops lmv_md_ops = { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 72310d1..7e95582 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1959,16 +1959,6 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid, RETURN(seq_client_alloc_fid(seq, fid)); } -/* XXX This method is used only to clear current fid seq - * once fld/mds insert failed */ -static int mdc_fid_delete(struct obd_export *exp, const struct lu_fid *fid) -{ - struct client_obd *cli = &exp->exp_obd->u.cli; - - seq_client_flush(cli->cl_seq); - return 0; -} - struct obd_uuid *mdc_get_uuid(struct obd_export *exp) { struct client_obd *cli = &exp->exp_obd->u.cli; return &cli->cl_target_uuid; @@ -2296,7 +2286,6 @@ struct obd_ops mdc_obd_ops = { .o_fid_init = mdc_fid_init, .o_fid_fini = mdc_fid_fini, .o_fid_alloc = mdc_fid_alloc, - .o_fid_delete = mdc_fid_delete, .o_import_event = mdc_import_event, .o_llog_init = mdc_llog_init, .o_llog_finish = mdc_llog_finish, diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 9808db6..2377edd 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -1470,7 +1470,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, fid_init); LPROCFS_OBD_OP_INIT(num_private_stats, stats, fid_fini); LPROCFS_OBD_OP_INIT(num_private_stats, stats, fid_alloc); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, fid_delete); LPROCFS_OBD_OP_INIT(num_private_stats, stats, statfs); LPROCFS_OBD_OP_INIT(num_private_stats, stats, statfs_async); LPROCFS_OBD_OP_INIT(num_private_stats, stats, packmd); -- 1.8.3.1