aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-cluster/lustre/files/0004-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch')
-rw-r--r--sys-cluster/lustre/files/0004-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch199
1 files changed, 199 insertions, 0 deletions
diff --git a/sys-cluster/lustre/files/0004-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch b/sys-cluster/lustre/files/0004-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch
new file mode 100644
index 000000000..b83551623
--- /dev/null
+++ b/sys-cluster/lustre/files/0004-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch
@@ -0,0 +1,199 @@
+From ae21b1ad797973ad686dfc1c0cad8d313ddaf4d7 Mon Sep 17 00:00:00 2001
+From: Andreas Dilger <andreas.dilger@intel.com>
+Date: Tue, 6 May 2014 09:51:45 -0400
+Subject: [PATCH 4/6] LU-2096 lprocfs: symlinks for forward compatibility
+
+Currently, the "ofd" device is still named "obdfilter" in the Lustre
+configuration and in /proc/fs/lustre. It would be better to name it
+"ost" which is has been the long term goal but retain the "ofd"
+module name.
+
+The per-OST device statistics should really be under "ost/{target}",
+like the per-MDT statistics are under "mdt/{target}" already in 2.x.
+
+Similarly, the "OSS" statistics have always been under "ost/OSS", but
+would be better in their own "oss" subdirectory much like what is done
+for "MDS" statistics.
+
+Add symlinks in lprocfs for "ost/OSS -> oss", "obdfilter -> ofd -> ost",
+and "obdfilter/{target} -> ost/{target}" for forward compatibility so
+that when we finally are able to make these changes to the module names
+userspace tools and scripts can have a smoother transition between
+Lustre versions.
+
+Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
+Signed-off-by: John L. Hammond <john.hammond@intel.com>
+Signed-off-by: James Simmons <uja.ornl@gmail.com>
+Change-Id: Ia0835e39aba7c8a540a6247bd3d56bc14e500c1e
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ lustre/include/obd.h | 4 ++--
+ lustre/mgs/mgs_llog.c | 4 ++--
+ lustre/obdclass/genops.c | 2 +-
+ lustre/ofd/ofd_dev.c | 32 +++++++++++++++++++++++++++++++-
+ lustre/ofd/ofd_internal.h | 2 ++
+ lustre/ost/ost_handler.c | 12 +++++++++++-
+ 6 files changed, 49 insertions(+), 7 deletions(-)
+
+diff --git a/lustre/include/obd.h b/lustre/include/obd.h
+index 3abcc4d..a79c901 100644
+--- a/lustre/include/obd.h
++++ b/lustre/include/obd.h
+@@ -516,8 +516,8 @@ struct niobuf_local {
+ #define LUSTRE_MDS_NAME "mds"
+ #define LUSTRE_MDT_NAME "mdt"
+ #define LUSTRE_MDC_NAME "mdc"
+-#define LUSTRE_OSS_NAME "ost" /* FIXME change name to oss */
+-#define LUSTRE_OST_NAME "obdfilter" /* FIXME change name to ost */
++#define LUSTRE_OSS_NAME "oss"
++#define LUSTRE_OST_NAME "ost"
+ #define LUSTRE_OSC_NAME "osc"
+ #define LUSTRE_LOV_NAME "lov"
+ #define LUSTRE_MGS_NAME "mgs"
+diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c
+index aca72e3..cd1174d 100644
+--- a/lustre/mgs/mgs_llog.c
++++ b/lustre/mgs/mgs_llog.c
+@@ -2450,7 +2450,7 @@ static int mgs_write_log_ost(const struct lu_env *env,
+ }
+
+ /*
+- attach obdfilter ost1 ost1_UUID
++ attach ost ost1 ost1_UUID
+ setup /dev/loop2 ldiskfs f|n errors=remount-ro,user_xattr
+ */
+ if (class_find_param(ptr, PARAM_FAILMODE, &ptr) == 0)
+@@ -2466,7 +2466,7 @@ static int mgs_write_log_ost(const struct lu_env *env,
+ snprintf(mti->mti_uuid, sizeof(mti->mti_uuid),
+ "%s_UUID", mti->mti_svname);
+ rc = record_attach(env, llh, mti->mti_svname,
+- "obdfilter"/*LUSTRE_OST_NAME*/, mti->mti_uuid);
++ "ost"/*LUSTRE_OST_NAME*/, mti->mti_uuid);
+ if (rc)
+ GOTO(out_end, rc);
+ rc = record_setup(env, llh, mti->mti_svname,
+diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c
+index d7c541a..1479f5a 100644
+--- a/lustre/obdclass/genops.c
++++ b/lustre/obdclass/genops.c
+@@ -121,7 +121,7 @@ struct obd_type *class_get_type(const char *name)
+ if (!type) {
+ const char *modname = name;
+
+- if (strcmp(modname, "obdfilter") == 0)
++ if (strcmp(modname, "ost") == 0)
+ modname = "ofd";
+
+ if (strcmp(modname, LUSTRE_LWP_NAME) == 0)
+diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c
+index 0f0d51a..b597b03 100644
+--- a/lustre/ofd/ofd_dev.c
++++ b/lustre/ofd/ofd_dev.c
+@@ -2375,10 +2375,23 @@ static struct lu_device_type ofd_device_type = {
+ .ldt_ctx_tags = LCT_DT_THREAD
+ };
+
++/*
++ * In the normal case all we have one symlink, type->typ_procsym to
++ * address the renaming of proc directories due to the OSD api
++ * introducton. OFD is special in that this subsystem the name has
++ * changed from obdfilter to ofd to lastly ost. So we need two
++ * symlinks to point to "ost". Hopefully in 2.9 we can removal all
++ * this symlink madness.
++ *
++ * Symlink called "obdfilter" that points to "ost" directory.
++ */
++static struct proc_dir_entry *ofd_symlink;
++
+ int __init ofd_init(void)
+ {
+ struct lprocfs_static_vars lvars;
+- int rc;
++ struct obd_type *type;
++ int rc;
+
+ rc = lu_kmem_init(ofd_caches);
+ if (rc)
+@@ -2397,13 +2410,30 @@ int __init ofd_init(void)
+ lvars.module_vars,
+ #endif
+ LUSTRE_OST_NAME, &ofd_device_type);
++
++ /* For forward compatibility symlink "obdfilter" and "ofd" to "ost"
++ * in procfs. Remove the symlinks entirely when access via
++ * "obdfilter/ofd" can be deprecated, maybe 2.9? */
++ type = class_search_type(LUSTRE_OST_NAME);
++ LASSERT(type != NULL);
++ type->typ_procsym = lprocfs_add_symlink("ofd", proc_lustre_root,
++ "ost");
++
++ ofd_symlink = lprocfs_add_symlink("obdfilter", proc_lustre_root,
++ "ost");
+ return rc;
+ }
+
+ void __exit ofd_exit(void)
+ {
++ struct obd_type *type = class_search_type(LUSTRE_OST_NAME);
++
+ ofd_fmd_exit();
+ lu_kmem_fini(ofd_caches);
++ if (ofd_symlink)
++ lprocfs_remove(&ofd_symlink);
++ if (type->typ_procsym)
++ lprocfs_remove(&type->typ_procsym);
+ class_unregister_type(LUSTRE_OST_NAME);
+ }
+
+diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h
+index 4f12506..98a5cba 100644
+--- a/lustre/ofd/ofd_internal.h
++++ b/lustre/ofd/ofd_internal.h
+@@ -193,6 +193,8 @@ struct ofd_device {
+ struct ptlrpc_thread ofd_inconsistency_thread;
+ struct list_head ofd_inconsistency_list;
+ spinlock_t ofd_inconsistency_lock;
++ /* create a symlink "obdfilter" from the "ost" directory */
++ struct proc_dir_entry *ofd_symlink;
+ };
+
+ static inline struct ofd_device *ofd_dev(struct lu_device *d)
+diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c
+index bae0a40..02ddb87 100644
+--- a/lustre/ost/ost_handler.c
++++ b/lustre/ost/ost_handler.c
+@@ -95,13 +95,20 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
+ RETURN(rc);
+
+ #ifdef LPROCFS
++ obd->obd_type->typ_procsym = lprocfs_add_symlink("ost/OSS", proc_lustre_root,
++ "../oss/OSS");
++ if (IS_ERR(obd->obd_type->typ_procsym)) {
++ CERROR("ost: can't create compat entry \"ost/OSS\": %d\n",
++ (int)PTR_ERR(obd->obd_type->typ_procsym));
++ obd->obd_type->typ_procsym = NULL;
++ }
+ obd->obd_vars = lprocfs_ost_obd_vars;
+ lprocfs_seq_obd_setup(obd);
+ #endif
+ mutex_init(&ost->ost_health_mutex);
+
+ svc_conf = (typeof(svc_conf)) {
+- .psc_name = LUSTRE_OSS_NAME,
++ .psc_name = "ost",
+ .psc_watchdog_factor = OSS_SERVICE_WATCHDOG_FACTOR,
+ .psc_buf = {
+ .bc_nbufs = OST_NBUFS,
+@@ -379,6 +386,9 @@ static int ost_cleanup(struct obd_device *obd)
+
+ mutex_unlock(&ost->ost_health_mutex);
+
++ if (obd->obd_type->typ_procsym)
++ lprocfs_remove(&obd->obd_type->typ_procsym);
++
+ lprocfs_obd_cleanup(obd);
+
+ if (ost_io_cptable != NULL) {
+--
+1.9.3
+