This patch changes llapi_root_path_open() first argument
form char * to const char * as the argument passed is
not modified.
This patch also fixes llapi_rmfid and llapi_root_path_open
man page.
Fixes:
5d93025240 ("LU-16427 lfs: rmfid does not print anything on error")
Reported-by: Thomas Bertschinger <bertschinger@lanl.gov>
Test-Parameters: trivial testlist=sanity
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I81de8cb9280af91af8a2de8dbb51f8e82807220d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50909
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Thomas Bertschinger <bertschinger@lanl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
.TP
.SM -ENOMEM
Not enough memory to process the request
+.TP
+.SM -ENOTTY
+.I file
+may not point to a Lustre filesystem mountpoint
.SH "SEE ALSO"
.BR lustreapi (7)
.BR llapi_rmfid_at (3)
.B #include <lustre/lustreapi.h>
.sp
-.BI "int llapi_root_path_open(char *"device ", int *" fd " );
+.BI "int llapi_root_path_open(const char *"device ", int *" fd " );
.sp
.fi
.B llapi_root_path_open(\|)
is called with
.I device
-which points to the FSNAME or complet path. On success
+which points to the FSNAME or complete path specifying a mountpount of Lustre
+filesystem. On success,
.I fd
is populated with valid descriptor.
char *name, size_t name_size);
int llapi_rmfid(const char *path, struct fid_array *fa);
int llapi_rmfid_at(int fd, struct fid_array *fa);
-int llapi_root_path_open(char *device, int *outfd);
+int llapi_root_path_open(const char *device, int *outfd);
int llapi_chomp_string(char *buf);
struct file_handle;
static int lfs_rmfid(int argc, char **argv)
{
- char *fidstr, *device;
int rc = 0, rc2, rc3 = 0, nr;
struct fid_array *fa;
+ const char *device;
+ char *fidstr;
int rootfd;
/* Interactive mode: Adjust optind */
* \retval 0 on success
* \retval -ve on failure
*/
-int llapi_root_path_open(char *device, int *rootfd)
+int llapi_root_path_open(const char *device, int *rootfd)
{
int tmp_fd, rc;
{
int rootfd, rc;
- rc = llapi_root_path_open((char *)path, &rootfd);
+ rc = llapi_root_path_open(path, &rootfd);
if (rc < 0) {
fprintf(stderr,
"lfs rmfid: error opening device/fsname '%s': %s\n",