From 0631caae7d804720de275ac557dda52d7f6e5084 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 3 Sep 2021 19:22:18 -0400 Subject: [PATCH] LU-10391 uapi: move out kernel only code. Userland doesn't use the new IPv6 function in the UAPI nidstr.h. So move this to the kernel header lib-types.h. Normally this wouldn't matter but the python wrappers break with the LUTF project. With the move to Netlink in the future for the user land API we shouldn't need these functions anyways. Test-parameters: trivial Change-Id: I2ac6d102d4575f639573253c21723d62ca08abc2 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/44844 Reviewed-by: Neil Brown Reviewed-by: Chris Horn Reviewed-by: Amir Shehata Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/include/lnet/lib-types.h | 16 ++++++++++++++++ lnet/include/uapi/linux/lnet/nidstr.h | 13 +------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index f4a64af..1d8917b 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -53,6 +53,22 @@ #include #include +char *libcfs_nidstr_r(const struct lnet_nid *nid, + char *buf, size_t buf_size); + +static inline char *libcfs_nidstr(const struct lnet_nid *nid) +{ + return libcfs_nidstr_r(nid, libcfs_next_nidstring(), + LNET_NIDSTR_SIZE); +} + +int libcfs_strnid(struct lnet_nid *nid, const char *str); +char *libcfs_idstr(struct lnet_processid *id); + +int cfs_match_nid_net(struct lnet_nid *nid, u32 net, + struct list_head *net_num_list, + struct list_head *addr); + /* Max payload size */ #define LNET_MAX_PAYLOAD LNET_MTU diff --git a/lnet/include/uapi/linux/lnet/nidstr.h b/lnet/include/uapi/linux/lnet/nidstr.h index d7e82a8..ea92a17 100644 --- a/lnet/include/uapi/linux/lnet/nidstr.h +++ b/lnet/include/uapi/linux/lnet/nidstr.h @@ -84,27 +84,16 @@ static inline char *libcfs_nid2str(lnet_nid_t nid) return libcfs_nid2str_r(nid, libcfs_next_nidstring(), LNET_NIDSTR_SIZE); } -char *libcfs_nidstr_r(const struct lnet_nid *nid, - char *buf, __kernel_size_t buf_size); -static inline char *libcfs_nidstr(const struct lnet_nid *nid) -{ - return libcfs_nidstr_r(nid, libcfs_next_nidstring(), - LNET_NIDSTR_SIZE); -} + __u32 libcfs_str2net(const char *str); lnet_nid_t libcfs_str2nid(const char *str); -int libcfs_strnid(struct lnet_nid *nid, const char *str); int libcfs_str2anynid(lnet_nid_t *nid, const char *str); int libcfs_num_parse(char *str, int len, struct list_head *list); char *libcfs_id2str(struct lnet_process_id id); -char *libcfs_idstr(struct lnet_processid *id); void cfs_free_nidlist(struct list_head *list); int cfs_parse_nidlist(char *str, int len, struct list_head *list); int cfs_print_nidlist(char *buffer, int count, struct list_head *list); int cfs_match_nid(lnet_nid_t nid, struct list_head *list); -int cfs_match_nid_net(struct lnet_nid *nid, __u32 net, - struct list_head *net_num_list, - struct list_head *addr); int cfs_match_net(__u32 net_id, __u32 net_type, struct list_head *net_num_list); -- 1.8.3.1