staging: lustre: replace static value with define
authorTristan Lelong <tristan@lelong.xyz>
Sun, 7 Dec 2014 00:00:30 +0000 (16:00 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2015 23:29:31 +0000 (15:29 -0800)
This patch replace the value '80' used in several files in the lustre source code
with a define LUSTRE_MDT_MAXNAMELEN.

This value is used in 4 different structures as the maximum len for a service name.
According to the comments, these names follow a convention which make it possible
to use the same define for LCS, LSS, LCF, and LSF.

Signed-off-by: Tristan Lelong <tristan@lelong.xyz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/fld/fld_internal.h
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
drivers/staging/lustre/lustre/include/lustre_fid.h
drivers/staging/lustre/lustre/include/lustre_fld.h

index 8806b6096953cfd1e8a731dc2d202f80dcad69cb..6125bbe822b55f72c23979daafc5a029c29ebd95 100644 (file)
@@ -111,7 +111,7 @@ struct fld_cache {
 
        /**
         * Cache name used for debug and messages. */
-       char                 fci_name[80];
+       char                 fci_name[LUSTRE_MDT_MAXNAMELEN];
        unsigned int             fci_no_shrink:1;
 };
 
index 7b7457cf70e3b550dfcff0bc9f00bc2609bdd48d..305ecbee9b7848ab3e2e53c860211b6cf135a33e 100644 (file)
  * FOO_BULK_PORTAL    is for incoming bulk on the FOO
  */
 
+/* Lustre service names are following the format
+ * service name + MDT + seq name
+ */
+#define LUSTRE_MDT_MAXNAMELEN  80
+
 #define CONNMGR_REQUEST_PORTAL   1
 #define CONNMGR_REPLY_PORTAL       2
 //#define OSC_REQUEST_PORTAL       3
index 2d6fbb4b1b39fa31270d4438db01198fc6cca3c6..0a0929fd9023eef1d2582ec248313276b6636bb1 100644 (file)
@@ -358,7 +358,7 @@ struct lu_client_seq {
         * Service uuid, passed from MDT + seq name to form unique seq name to
         * use it with procfs.
         */
-       char                lcs_name[80];
+       char                lcs_name[LUSTRE_MDT_MAXNAMELEN];
 
        /*
         * Sequence width, that is how many objects may be allocated in one
@@ -408,7 +408,7 @@ struct lu_server_seq {
         * Service uuid, passed from MDT + seq name to form unique seq name to
         * use it with procfs.
         */
-       char                lss_name[80];
+       char                lss_name[LUSTRE_MDT_MAXNAMELEN];
 
        /*
         * Allocation chunks for super and meta sequences. Default values are
index 64c504849a22483f81c516df96eef783434d8b8c..5ee4b1ed099502c18a9d0b638409ecc5c317086d 100644 (file)
@@ -93,7 +93,7 @@ struct lu_server_fld {
 
        /**
         * Fld service name in form "fld-srv-lustre-MDTXXX" */
-       char                 lsf_name[80];
+       char                 lsf_name[LUSTRE_MDT_MAXNAMELEN];
 
 };
 
@@ -124,7 +124,7 @@ struct lu_client_fld {
 
        /**
         * Client fld proc entry name. */
-       char                 lcf_name[80];
+       char                 lcf_name[LUSTRE_MDT_MAXNAMELEN];
 
        int                   lcf_flags;
 };