+#ifdef HAVE_SERVER_SUPPORT
+/* Register the "lustre_tgt" fs type.
+ *
+ * Right now this isn't any different than the normal "lustre" filesystem
+ * type, but it is added so that there is some compatibility to allow
+ * changing documentation and scripts to start using the "lustre_tgt" type
+ * at mount time. That will simplify test interop, and in case of upgrades
+ * that change to the new type and then need to roll back for some reason.
+ *
+ * The long-term goal is to disentangle the client and server mount code.
+ */
+static struct file_system_type lustre_fs_type_tgt = {
+ .owner = THIS_MODULE,
+ .name = "lustre_tgt",
+#ifdef HAVE_FSTYPE_MOUNT
+ .mount = lustre_mount,
+#else
+ .get_sb = lustre_get_sb,
+#endif
+ .kill_sb = lustre_kill_super,
+ .fs_flags = FS_REQUIRES_DEV | FS_RENAME_DOES_D_MOVE,
+};
+MODULE_ALIAS_FS("lustre_tgt");
+
+#define register_filesystem_tgt(fstype) \
+do { \
+ int _rc; \
+ \
+ _rc = register_filesystem(fstype); \
+ if (_rc && _rc != -EBUSY) { \
+ /* Don't fail if server code also registers "lustre_tgt" */ \
+ CERROR("obdclass: register fstype '%s' failed: rc = %d\n", \
+ (fstype)->name, _rc); \
+ return _rc; \
+ } \
+} while (0)
+#define unregister_filesystem_tgt(fstype) unregister_filesystem(fstype)
+#else
+#define register_filesystem_tgt(fstype) do {} while (0)
+#define unregister_filesystem_tgt(fstype) do {} while (0)
+#endif
+