Whamcloud - gitweb
LU-6245 libcfs: move struct netstrfns to nidstr.h 83/15083/2
authorJames Simmons <uja.ornl@yahoo.com>
Fri, 29 May 2015 23:31:52 +0000 (19:31 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 5 Jun 2015 01:49:05 +0000 (01:49 +0000)
The reason struct netstrfns exist in nidstrings.c
was to avoid forward decleration errors. The best
way to handle this instead is to move this structure
to a header file. Since this structure is used in
the userland utilities as well so we place it in
nidstr.h which is exposed to userland.

Change-Id: I02610e90a8d252defc9e8778f9f86be5ab2de9fe
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/15083
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/libcfs/util/nidstrings.c
lnet/include/lnet/nidstr.h
lnet/lnet/nidstrings.c

index 3a9087f..2076387 100644 (file)
@@ -104,22 +104,6 @@ static int  libcfs_ip_addr_range_print(char *buffer, int count,
 static bool cfs_num_is_contiguous(struct list_head *nidlist);
 static void cfs_num_min_max(struct list_head *nidlist, __u32 *min, __u32 *max);
 
 static bool cfs_num_is_contiguous(struct list_head *nidlist);
 static void cfs_num_min_max(struct list_head *nidlist, __u32 *min, __u32 *max);
 
-struct netstrfns {
-       __u32 nf_type;
-       char    *nf_name;
-       char    *nf_modname;
-       void    (*nf_addr2str)(__u32 addr, char *str, size_t size);
-       int     (*nf_str2addr)(const char *str, int nob, __u32 *addr);
-       int     (*nf_parse_addrlist)(char *str, int len,
-                                       struct list_head *list);
-       int     (*nf_print_addrlist)(char *buffer, int count,
-                                    struct list_head *list);
-       int     (*nf_match_addr)(__u32 addr, struct list_head *list);
-       bool    (*nf_is_contiguous)(struct list_head *nidlist);
-       void    (*nf_min_max)(struct list_head *nidlist, __u32 *min_nid,
-                             __u32 *max_nid);
-};
-
 static struct netstrfns  libcfs_netstrfns[] = {
        {/* .nf_type      */  LOLND,
         /* .nf_name      */  "lo",
 static struct netstrfns  libcfs_netstrfns[] = {
        {/* .nf_type      */  LOLND,
         /* .nf_name      */  "lo",
index a0b3059..a0ed3e6 100644 (file)
@@ -91,4 +91,20 @@ bool cfs_nidrange_is_contiguous(struct list_head *nidlist);
 void cfs_nidrange_find_min_max(struct list_head *nidlist, char *min_nid,
                               char *max_nid, size_t nidstr_length);
 
 void cfs_nidrange_find_min_max(struct list_head *nidlist, char *min_nid,
                               char *max_nid, size_t nidstr_length);
 
+struct netstrfns {
+       __u32   nf_type;
+       char    *nf_name;
+       char    *nf_modname;
+       void    (*nf_addr2str)(__u32 addr, char *str, size_t size);
+       int     (*nf_str2addr)(const char *str, int nob, __u32 *addr);
+       int     (*nf_parse_addrlist)(char *str, int len,
+                                    struct list_head *list);
+       int     (*nf_print_addrlist)(char *buffer, int count,
+                                    struct list_head *list);
+       int     (*nf_match_addr)(__u32 addr, struct list_head *list);
+       bool    (*nf_is_contiguous)(struct list_head *nidlist);
+       void    (*nf_min_max)(struct list_head *nidlist, __u32 *min_nid,
+                             __u32 *max_nid);
+};
+
 #endif /* _LNET_NIDSTRINGS_H */
 #endif /* _LNET_NIDSTRINGS_H */
index 8f3236d..59cccf9 100644 (file)
@@ -100,22 +100,6 @@ static int  libcfs_ip_addr_range_print(char *buffer, int count,
 static bool cfs_num_is_contiguous(struct list_head *nidlist);
 static void cfs_num_min_max(struct list_head *nidlist, __u32 *min, __u32 *max);
 
 static bool cfs_num_is_contiguous(struct list_head *nidlist);
 static void cfs_num_min_max(struct list_head *nidlist, __u32 *min, __u32 *max);
 
-struct netstrfns {
-       __u32 nf_type;
-       char    *nf_name;
-       char    *nf_modname;
-       void    (*nf_addr2str)(__u32 addr, char *str, size_t size);
-       int     (*nf_str2addr)(const char *str, int nob, __u32 *addr);
-       int     (*nf_parse_addrlist)(char *str, int len,
-                                       struct list_head *list);
-       int     (*nf_print_addrlist)(char *buffer, int count,
-                                    struct list_head *list);
-       int     (*nf_match_addr)(__u32 addr, struct list_head *list);
-       bool    (*nf_is_contiguous)(struct list_head *nidlist);
-       void    (*nf_min_max)(struct list_head *nidlist, __u32 *min_nid,
-                             __u32 *max_nid);
-};
-
 static struct netstrfns  libcfs_netstrfns[] = {
        {/* .nf_type      */  LOLND,
         /* .nf_name      */  "lo",
 static struct netstrfns  libcfs_netstrfns[] = {
        {/* .nf_type      */  LOLND,
         /* .nf_name      */  "lo",