Whamcloud - gitweb
LU-12410 libcfs: Implement address range expansion 03/35303/13
authorChris Horn <hornc@cray.com>
Sun, 23 Jun 2019 23:26:30 +0000 (18:26 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Dec 2019 03:25:35 +0000 (03:25 +0000)
commitb0d131cd725b82adbfa44b082a9c5446ef7194d4
treed15df7171a1f049f291ef0ca34be008b930d4549
parentca8958189198d8272551948dba7b36dea77c3180
LU-12410 libcfs: Implement address range expansion

Implements a new top-level API function for the nidstrings library.
cfs_expand_nidlist iterates over each nidrange on a nidlist and
expands the range to create the lnet_nid_t's defined by the nidrange.

The caller supplies the nidlist, an lnet_nid_t array pointer where the
lnet_nid_t's are stored, and the maximum number of LNet nids to
generate (i.e. the size of the lnet_nid_t array pointer).

cfs_expand_nidlist returns the number of lnet_nid_t's that were added
to the lnet_nid_t array.

If the provided nidlist defines more NIDs than the specified maximum
then the return value is -1.

Test-Parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I3e02f1ec466a8bc90142944b62565ebc7ef82e88
Reviewed-on: https://review.whamcloud.com/35303
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/util/nidstrings.c
lnet/include/uapi/linux/lnet/nidstr.h