From d231bc874075672d3302727e53baef8f4dd03287 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 29 May 2015 19:31:52 -0400 Subject: [PATCH] LU-6245 libcfs: move struct netstrfns to nidstr.h 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 Reviewed-on: http://review.whamcloud.com/15083 Tested-by: Jenkins Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- libcfs/libcfs/util/nidstrings.c | 16 ---------------- lnet/include/lnet/nidstr.h | 16 ++++++++++++++++ lnet/lnet/nidstrings.c | 16 ---------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/libcfs/libcfs/util/nidstrings.c b/libcfs/libcfs/util/nidstrings.c index 3a9087f..2076387 100644 --- a/libcfs/libcfs/util/nidstrings.c +++ b/libcfs/libcfs/util/nidstrings.c @@ -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); -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", diff --git a/lnet/include/lnet/nidstr.h b/lnet/include/lnet/nidstr.h index a0b3059..a0ed3e6 100644 --- a/lnet/include/lnet/nidstr.h +++ b/lnet/include/lnet/nidstr.h @@ -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); +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 */ diff --git a/lnet/lnet/nidstrings.c b/lnet/lnet/nidstrings.c index 8f3236d..59cccf9 100644 --- a/lnet/lnet/nidstrings.c +++ b/lnet/lnet/nidstrings.c @@ -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); -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", -- 1.8.3.1