Whamcloud - gitweb
LU-16491 utils: update getdirstripe yaml format 46/55346/10
authorFrederick Dilger <fdilger@whamcloud.com>
Thu, 6 Jun 2024 20:00:25 +0000 (16:00 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2024 03:31:11 +0000 (03:31 +0000)
commit45c557ece5186800f5567df7e1c58909bb25b338
treec158e85b38430fcce2dd6d71cc1a7ad110e35ac9
parent2a0127d5fba5462bdd2eb7530baeded454104a5a
LU-16491 utils: update getdirstripe yaml format

'lfs getdirstripe --yaml' now prints directory layout in yaml
format. getdirstripe now also prints the "self" FID whether the
directory is striped or not. "migrating" fields
(lmv_migrate_offset, lmv_migrate_hash) were not included because
of the additional code complexity required to add the two fields.
The migrating fields are stored in 'struct lmv_mds_md_v1' which
AFAIK isn't available though getdirstripe.

For 0 striped directories, lmv_objects: will now contain
information on the directory itself, this information
becomes redundant with -v, however it is useful when the
lmv_fid isn't being shown.

New YAML layout:

    lmv_fid:           0x280000404:0x5:0x0
    lmv_magic:         0xcd20cd0
    lmv_stripe_count:  4
    lmv_stripe_offset: 2
    lmv_hash_type:     crush
    lmv_objects:
          - l_mdt_idx: 2
            l_fid:     0x280000400:0x4:0x0
          - l_mdt_idx: 0
            l_fid:     0x200000402:0x4:0x0
          - l_mdt_idx: 1
            l_fid:     0x240000402:0x2:0x0
          - l_mdt_idx: 3
            l_fid:     0x2c0000403:0x2:0x0

Signed-off-by: Frederick Dilger <fdilger@whamcloud.com>
Change-Id: I03ddc24816484d11c8c70892831e9edc9da5455a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55346
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/doc/lfs-getdirstripe.1
lustre/tests/sanity.sh
lustre/tests/test-framework.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c