From: yury Date: Wed, 3 Sep 2008 08:39:47 +0000 (+0000) Subject: b=16772 X-Git-Tag: v1_7_110~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5ff981d4c676411588f88b72c7832ff5a22c9c87 b=16772 r=adilger,shadow - fixed using get_uuid2int() in llite which breaked cmd --- diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 65cd938..972ebed 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -1323,6 +1323,7 @@ struct obd_ops { enum obd_notify_event ev, void *data); int (*o_health_check)(struct obd_device *); + struct obd_uuid *(*o_get_uuid) (struct obd_export *exp); /* quota methods */ int (*o_quotacheck)(struct obd_export *, struct obd_quotactl *); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 0fae2a8..0fa132c 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -810,6 +810,18 @@ static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid) RETURN(rc); } +static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp) +{ + struct obd_uuid *uuid; + ENTRY; + + OBD_CHECK_DT_OP(exp->exp_obd, get_uuid, NULL); + EXP_COUNTER_INCREMENT(exp, get_uuid); + + uuid = OBP(exp->exp_obd, get_uuid)(exp); + RETURN(uuid); +} + static inline int obd_connect(const struct lu_env *env, struct lustre_handle *conn,struct obd_device *obd, struct obd_uuid *cluuid, diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 85b8d06..4c165a5 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -288,6 +288,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) struct lustre_handle dt_conn = {0, }; struct lustre_handle md_conn = {0, }; struct obd_connect_data *data = NULL; + struct obd_uuid *uuid; struct lustre_md lmd; obd_valid valid; int size, err, checksum; @@ -639,17 +640,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) sb->s_root->d_op = &ll_d_root_ops; sbi->ll_sdev_orig = sb->s_dev; -#if 0 + /* We set sb->s_dev equal on all lustre clients in order to support * NFS export clustering. NFSD requires that the FSID be the same * on all clients. */ /* s_dev is also used in lt_compare() to compare two fs, but that is * only a node-local comparison. */ - - /* XXX: this will not work with LMV */ - sb->s_dev = get_uuid2int(sbi2mdc(sbi)->cl_target_uuid.uuid, - strlen(sbi2mdc(sbi)->cl_target_uuid.uuid)); -#endif + uuid = obd_get_uuid(sbi->ll_md_exp); + if (uuid != NULL) + sb->s_dev = get_uuid2int(uuid->uuid, strlen(uuid->uuid)); RETURN(err); out_root: diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index de6470f..cd96327 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -160,6 +160,12 @@ static int lmv_set_mdc_data(struct lmv_obd *lmv, struct obd_uuid *uuid, RETURN(0); } +struct obd_uuid *lmv_get_uuid(struct obd_export *exp) { + struct obd_device *obd = exp->exp_obd; + struct lmv_obd *lmv = &obd->u.lmv; + return obd_get_uuid(lmv->tgts[0].ltd_exp); +} + static int lmv_notify(struct obd_device *obd, struct obd_device *watched, enum obd_notify_event ev, void *data) { @@ -2978,6 +2984,7 @@ struct obd_ops lmv_obd_ops = { .o_packmd = lmv_packmd, .o_unpackmd = lmv_unpackmd, .o_notify = lmv_notify, + .o_get_uuid = lmv_get_uuid, .o_iocontrol = lmv_iocontrol, .o_fid_delete = lmv_fid_delete }; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 19781c4..7bfe0cd 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1520,6 +1520,11 @@ static int mdc_fid_delete(struct obd_export *exp, const struct lu_fid *fid) 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; +} + static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg) { struct client_obd *cli = &obd->u.cli; @@ -1825,7 +1830,8 @@ struct obd_ops mdc_obd_ops = { .o_llog_init = mdc_llog_init, .o_llog_finish = mdc_llog_finish, .o_get_info = mdc_get_info, - .o_process_config = mdc_process_config, + .o_process_config = mdc_process_config, + .o_get_uuid = mdc_get_uuid, }; struct md_ops mdc_md_ops = { diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index bd90752..44c0dee 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -1184,6 +1184,7 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, import_event); LPROCFS_OBD_OP_INIT(num_private_stats, stats, notify); LPROCFS_OBD_OP_INIT(num_private_stats, stats, health_check); + LPROCFS_OBD_OP_INIT(num_private_stats, stats, get_uuid); LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotacheck); LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotactl); LPROCFS_OBD_OP_INIT(num_private_stats, stats, ping);