Whamcloud - gitweb
LU-12521 llapi: add separate fsname and instance API 51/35451/10
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 9 Jul 2019 18:47:19 +0000 (12:47 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Jan 2020 05:31:04 +0000 (05:31 +0000)
commit00d14521ca1cd38a5fff82e1639ad3cc944ee13d
tree02bb2565c4b0f500033e169bcb693026fa53a5d1
parent7ff384eee1945440d5cc9a0658750fa3276fba6a
LU-12521 llapi: add separate fsname and instance API

The llapi_getname() function returns the combined fsname and client
instance as one string, which is fine when using the entire string,
but the output cannot be safely parsed into separate fsname and
instance strings in all cases.

Introduce new llapi_get_fsname() and llapi_get_instance() functions
that return only the fsname and instance strings, since the source
string returned from the kernel can be unambiguously separated before
it is returned in a combined string via llapi_getname().

Fix the lfs_getname() '-n' and '-i' options to use the new routines
rather than parsing the output from llapi_getname().

Add man pages for these functions.

Fixes: 2a4821b836c8 ("LU-12159 utils: improve lfs getname functionality")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iaf5846a0ae147a428f66ec8a1d0251e7e12540e5
Reviewed-on: https://review.whamcloud.com/35451
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
lustre/doc/Makefile.am
lustre/doc/lfs-getname.1
lustre/doc/llapi_get_fsname.3 [new file with mode: 0644]
lustre/doc/llapi_get_fsname_instance.3 [new file with mode: 0644]
lustre/doc/llapi_get_instance.3 [new file with mode: 0644]
lustre/doc/llapi_getname.3 [new file with mode: 0644]
lustre/include/lustre/lustreapi.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/llite_lib.c
lustre/obdclass/obd_config.c
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_util.c