Whamcloud - gitweb
LU-3345 llapi: add user space method for lov_user_md
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index 6d0d385..ce51960 100644 (file)
@@ -524,7 +524,7 @@ static int get_param_lmv(const char *path,
 
 static int get_mds_md_size(const char *path)
 {
-       int md_size = lov_mds_md_size(LOV_MAX_STRIPE_COUNT, LOV_MAGIC_V3);
+       int md_size = lov_user_md_size(LOV_MAX_STRIPE_COUNT, LOV_USER_MAGIC_V3);
        char buf[80];
        int rc;
 
@@ -878,10 +878,11 @@ int get_root_path(int want, char *fsname, int *outfd, char *path, int index)
 
                 mntlen = strlen(mnt.mnt_dir);
                 ptr = strrchr(mnt.mnt_fsname, '/');
-                if (!ptr && !len) {
-                        rc = -EINVAL;
-                        break;
-                }
+               /* thanks to the call to llapi_is_lustre_mnt() above,
+                * we are sure that mnt.mnt_fsname contains ":/",
+                * so ptr should never be NULL */
+               if (ptr == NULL)
+                       continue;
                 ptr++;
 
                 /* Check the fsname for a match, if given */
@@ -2243,7 +2244,8 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
                 lov_dump_user_lmm_header(lum, path, objects, is_dir, header,
                                          depth, raw, pool_name);
 
-        if (!is_dir && (header & VERBOSE_OBJID)) {
+        if (!is_dir && (header & VERBOSE_OBJID) &&
+           !(lum->lmm_pattern & LOV_PATTERN_F_RELEASED)) {
                 if (obdstripe == 1)
                         llapi_printf(LLAPI_MSG_NORMAL,
                                   "\tobdidx\t\t objid\t\t objid\t\t group\n");
@@ -3096,7 +3098,7 @@ static int cb_getstripe(char *path, DIR *parent, DIR *d, void *data,
                         * The object_seq needs to be set for the "(Default)"
                         * prefix to be displayed. */
                        struct lov_user_md *lmm = &param->lmd->lmd_lmm;
-                       lmm->lmm_magic = LOV_MAGIC_V1;
+                       lmm->lmm_magic = LOV_USER_MAGIC_V1;
                        if (!param->raw)
                                ostid_set_seq(&lmm->lmm_oi,
                                              FID_SEQ_LOV_DEFAULT);