Whamcloud - gitweb
LU-13440 lmv: add default LMV inherit depth 31/43131/12
authorLai Siyao <lai.siyao@whamcloud.com>
Mon, 15 Mar 2021 03:57:36 +0000 (11:57 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 27 Apr 2021 20:17:01 +0000 (20:17 +0000)
commitf167f78e3bfdae3a3c398f8f91604e92ed41627e
treeefeb6496cf6b5ac4385f8baa96d312339c3949bf
parent809bd318183f9b14cccf04f10e34b7b367f19e53
LU-13440 lmv: add default LMV inherit depth

A new field "__u8 lum_max_inherit" is added into struct lmv_user_md,
which represents the inherit depth of default LMV. It will be
decreased by 1 for subdirectories.

The valid value of lum_max_inherit is [0, 255]:
* 0 means unlimited inherit.
* 1 means inherit end.
* 250 is the max inherit depth.
* [251, 254] are reserved.
* 255 means it's not set.

A new field "__u8 lum_max_inherit_rr" is added, if default stripe
offset is -1, lum_max_inherit_rr is non-zero, and system is balanced,
new directories are created in roundrobin mannner, otherwise they
are created on the MDT where their parents are located to avoid
creating remote directories. And similarly this value will be
decreased by 1 for each level of subdirectories.

The valid value of lum_max_inherit_rr is different:
* 0 means not set.
* 1 means inherit end.
* 250 is the max inherit depth.
* [251, 254] are reserved.
* 255 means unlimited inherit.

However for the user interface of "lfs", the valid value is [-1, 250]:
* -1 means unlimited inherit.
* 0 means not set.
* others are the same.

Add sanity 413c.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I98ccad8556a0469f83bd7d79f5086a2184d5b115
15 files changed:
lustre/doc/lfs-getdirstripe.1
lustre/doc/lfs-setdirstripe.1
lustre/include/lu_object.h
lustre/include/lustre/lustreapi.h
lustre/include/lustre_lmv.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/namei.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_internal.h
lustre/lod/lod_object.c
lustre/obdclass/lu_tgt_descs.c
lustre/ptlrpc/pack_generic.c
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c