Whamcloud - gitweb
LU-17995 obdclass: remove obdname2fsname() 74/58174/2
authorTimothy Day <timday@amazon.com>
Sun, 23 Feb 2025 18:26:59 +0000 (13:26 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:07:47 +0000 (08:07 +0000)
This function is not called anywhere.

Test-Parameters: trivial
Test-Parameters: trivial fstype=zfs
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ib6c92787685564e812634c8a466b9edc27ba6977
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58174
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Max Wang <wamax@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_disk.h
lustre/obdclass/obd_mount.c

index e39b310..28915c5 100644 (file)
@@ -376,7 +376,6 @@ int lustre_start_simple(char *obdname, char *type, char *uuid,
 int lustre_stop_mgc(struct super_block *sb);
 #endif /* HAVE_SERVER_SUPPORT */
 int server_name2fsname(const char *svname, char *fsname, const char **endptr);
-void obdname2fsname(const char *tgt, char *fsname, size_t fslen);
 
 int lustre_start_mgc(struct super_block *sb);
 int lustre_common_put_super(struct super_block *sb);
index 9ec1a92..124f552 100644 (file)
@@ -743,85 +743,6 @@ int lustre_put_lsi(struct super_block *sb)
 }
 EXPORT_SYMBOL(lustre_put_lsi);
 
-/*
- * The goal of this function is to extract the file system name
- * from the OBD name. This can come in two flavors. One is
- * fsname-MDTXXXX or fsname-XXXXXXX were X is a hexadecimal
- * number. In both cases we should return fsname. If it is
- * not a valid OBD name it is assumed to be the file system
- * name itself.
- */
-void obdname2fsname(const char *tgt, char *fsname, size_t buflen)
-{
-       const char *ptr;
-       const char *tmp;
-       size_t len = 0;
-
-       /*
-        * First we have to see if the @tgt has '-' at all. It is
-        * valid for the user to request something like
-        * lctl set_param -P llite.lustre*.xattr_cache=0
-        */
-       ptr = strrchr(tgt, '-');
-       if (!ptr) {
-               /* No '-' means it could end in '*' */
-               ptr = strchr(tgt, '*');
-               if (!ptr) {
-                       /* No '*' either. Assume tgt = fsname */
-                       len = strlen(tgt);
-                       goto valid_obd_name;
-               }
-               len = ptr - tgt;
-               goto valid_obd_name;
-       }
-
-       /* tgt format fsname-MDT0000-* */
-       if ((!strncmp(ptr, "-MDT", 4) ||
-            !strncmp(ptr, "-OST", 4)) &&
-            (isxdigit(ptr[4]) && isxdigit(ptr[5]) &&
-             isxdigit(ptr[6]) && isxdigit(ptr[7]))) {
-               len = ptr - tgt;
-               goto valid_obd_name;
-       }
-
-       /*
-        * tgt_format fsname-cli'dev'-'uuid' except for the llite case
-        * which are named fsname-'uuid'. Examples:
-        *
-        * lustre-clilov-ffff88104db5b800
-        * lustre-ffff88104db5b800  (for llite device)
-        *
-        * The length of the OBD uuid can vary on different platforms.
-        * This test if any invalid characters are in string. Allow
-        * wildcards with '*' character.
-        */
-       ptr++;
-       if (!strspn(ptr, "0123456789abcdefABCDEF*")) {
-               len = 0;
-               goto no_fsname;
-       }
-
-       /*
-        * Now that we validated the device name lets extract the
-        * file system name. Most of the names in this class will
-        * have '-cli' in its name which needs to be dropped. If
-        * it doesn't have '-cli' then its a llite device which
-        * ptr already points to the start of the uuid string.
-        */
-       tmp = strstr(tgt, "-cli");
-       if (tmp)
-               ptr = tmp;
-       else
-               ptr--;
-       len = ptr - tgt;
-valid_obd_name:
-       len = min_t(size_t, len, LUSTRE_MAXFSNAME);
-       snprintf(fsname, buflen, "%.*s", (int)len, tgt);
-no_fsname:
-       fsname[len] = '\0';
-}
-EXPORT_SYMBOL(obdname2fsname);
-
 /**
  * SERVER NAME ***
  * <FSNAME><SEPARATOR><TYPE><INDEX>