From: Vitaly Fertman Date: Thu, 18 Aug 2022 15:40:03 +0000 (+0300) Subject: LU-16526 lmv: module params for default dir layout X-Git-Tag: 2.15.55~94 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=cfc3b5ee46d606aef162b6ab7ee385e99ef25ab7;p=fs%2Flustre-release.git LU-16526 lmv: module params for default dir layout add module parameters to let the default ROOT layout to be flexible enough to be disabled now and set to something arbitrary in future. HPE-bug-id: LUS-11140 Signed-off-by: Vitaly Fertman Change-Id: I66cae2e0aa5be9c56552bcf0e8810f3f1b944836 Reviewed-on: https://es-gerrit.dev.cray.com/161058 Reviewed-by: Alexander Boyko Reviewed-by: Alexey Lyashkov Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49878 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 6fb4889..18cefa3 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -72,6 +72,25 @@ static struct lu_kmem_descr mdd_caches[] = { } }; +/** + * Mod params for the fs-wide (stored in ROOT) default dir layout, + * to be set and stored in EA, if EA is absent yet: + * + * stripe_offset, max_inherit, max_inherit_rr, see lfs setdirstripe for more + * details. + */ +static unsigned int root_stripe_offset = LMV_OFFSET_DEFAULT; +module_param(root_stripe_offset, uint, 0444); +MODULE_PARM_DESC(root_stripe_offset, "fs-wide default LMV stripe offset"); + +static unsigned int root_max_inherit = LMV_INHERIT_UNLIMITED; +module_param(root_max_inherit, uint, 0444); +MODULE_PARM_DESC(root_max_inherit, "fs-wide default LMV max_inherit"); + +static unsigned int root_max_inherit_rr = LMV_INHERIT_RR_ROOT; +module_param(root_max_inherit_rr, uint, 0444); +MODULE_PARM_DESC(root_max_inherit_rr, "fs-wide default LMV max_inherit_rr"); + static int mdd_connect_to_next(const struct lu_env *env, struct mdd_device *m, const char *nextdev) { @@ -1328,9 +1347,9 @@ static int mdd_prepare(const struct lu_env *env, struct lmv_user_md lmv_default = { .lum_magic = LMV_USER_MAGIC, .lum_stripe_count = 1, - .lum_stripe_offset = LMV_OFFSET_DEFAULT, - .lum_max_inherit = LMV_INHERIT_UNLIMITED, - .lum_max_inherit_rr = LMV_INHERIT_RR_ROOT, + .lum_stripe_offset = root_stripe_offset, + .lum_max_inherit = root_max_inherit, + .lum_max_inherit_rr = root_max_inherit_rr, }; th = dt_trans_create(env, mdd->mdd_bottom);