Whamcloud - gitweb
LU-12511 lustre: introduce LUSTRE_MDT_MAXNAMELEN 38/37738/5
authorMr NeilBrown <neilb@suse.de>
Thu, 27 Feb 2020 02:43:25 +0000 (13:43 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 24 Mar 2020 05:15:58 +0000 (05:15 +0000)
Various char arrays which can contain a target name are
declared as [80].
Instead of a "magic constant" introduce LUSTRE_MD_MAXNAMELEN
and use that instead.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I029b8086d081297f4018ba9752c484b1ebd596db
Reviewed-on: https://review.whamcloud.com/37738
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/fld/fld_internal.h
lustre/include/lustre_fid.h
lustre/include/lustre_fld.h

index 1230b17..9579cfe 100644 (file)
@@ -110,13 +110,15 @@ struct fld_cache {
          * sorted fld entries. */
        struct list_head        fci_entries_head;
 
-        /**
-         * Cache statistics. */
-        struct fld_stats         fci_stat;
+       /**
+        * Cache statistics.
+        */
+       struct fld_stats        fci_stat;
 
-        /**
-         * Cache name used for debug and messages. */
-        char                     fci_name[80];
+       /**
+        * Cache name used for debug and messages.
+        */
+       char                    fci_name[LUSTRE_MDT_MAXNAMELEN];
 };
 
 enum {
index ea6d743..1748c8d 100644 (file)
 #include <uapi/linux/lustre/lustre_idl.h>
 #include <uapi/linux/lustre/lustre_ostid.h>
 
+/* Lustre service names are following the format
+ * service name + MDT + seq name
+ */
+#define LUSTRE_MDT_MAXNAMELEN          80
+
 struct lu_env;
 struct lu_site;
 struct lu_context;
@@ -425,11 +430,11 @@ struct lu_client_seq {
         /* LUSTRE_SEQ_METADATA or LUSTRE_SEQ_DATA */
         enum lu_cli_type        lcs_type;
 
-        /*
-         * Service uuid, passed from MDT + seq name to form unique seq name to
+       /*
+        * Service uuid, passed from MDT + seq name to form unique seq name to
         * use it with debugfs.
-         */
-        char                    lcs_name[80];
+        */
+       char                    lcs_name[LUSTRE_MDT_MAXNAMELEN];
 
         /*
          * Sequence width, that is how many objects may be allocated in one
@@ -475,11 +480,11 @@ struct lu_server_seq {
         /* Mutex for protecting allocation */
        struct mutex            lss_mutex;
 
-        /*
-         * Service uuid, passed from MDT + seq name to form unique seq name to
+       /*
+        * Service uuid, passed from MDT + seq name to form unique seq name to
         * use it with debugfs.
-         */
-        char                    lss_name[80];
+        */
+       char                    lss_name[LUSTRE_MDT_MAXNAMELEN];
 
         /*
          * Allocation chunks for super and meta sequences. Default values are
index 102dcfa..3d8288b 100644 (file)
@@ -41,6 +41,7 @@
 #include <uapi/linux/lustre/lustre_idl.h>
 #include <libcfs/libcfs.h>
 #include <seq_range.h>
+#include <lustre_fid.h>
 
 struct lu_env;
 struct lu_client_fld;
@@ -89,9 +90,10 @@ struct lu_server_fld {
          * Protect index modifications */
        struct mutex            lsf_lock;
 
-        /**
-         * Fld service name in form "fld-srv-lustre-MDTXXX" */
-        char                     lsf_name[80];
+       /**
+        * Fld service name in form "fld-srv-lustre-MDTXXX"
+        */
+       char                    lsf_name[LUSTRE_MDT_MAXNAMELEN];
 
        int (*lsf_seq_lookup)(const struct lu_env *env,
                              struct lu_server_fld *fld, u64 seq,
@@ -133,10 +135,10 @@ struct lu_client_fld {
          * Client FLD cache. */
         struct fld_cache        *lcf_cache;
 
-        /**
+       /**
         * Client fld debugfs entry name.
         */
-        char                     lcf_name[80];
+       char                    lcf_name[LUSTRE_MDT_MAXNAMELEN];
 };
 
 /* Server methods */