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 *);
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,
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;
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:
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)
{
.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
};
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;
.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 = {
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);