Skip to content

Commit 7452a6d

Browse files
author
Christoph Hellwig
committed
xfs: add a max_open_zones mount option
Allow limiting the number of open zones used below that exported by the device. This is required to tune the number of write streams when zoned RT devices are used on conventional devices, and can be useful on zoned devices that support a very large number of open zones. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
1 parent 97c69ba commit 7452a6d

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

fs/xfs/xfs_super.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ enum {
110110
Opt_filestreams, Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota,
111111
Opt_prjquota, Opt_uquota, Opt_gquota, Opt_pquota,
112112
Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce,
113-
Opt_discard, Opt_nodiscard, Opt_dax, Opt_dax_enum,
113+
Opt_discard, Opt_nodiscard, Opt_dax, Opt_dax_enum, Opt_max_open_zones,
114114
};
115115

116116
static const struct fs_parameter_spec xfs_fs_parameters[] = {
@@ -155,6 +155,7 @@ static const struct fs_parameter_spec xfs_fs_parameters[] = {
155155
fsparam_flag("nodiscard", Opt_nodiscard),
156156
fsparam_flag("dax", Opt_dax),
157157
fsparam_enum("dax", Opt_dax_enum, dax_param_enums),
158+
fsparam_u32("max_open_zones", Opt_max_open_zones),
158159
{}
159160
};
160161

@@ -234,6 +235,9 @@ xfs_fs_show_options(
234235
if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
235236
seq_puts(m, ",noquota");
236237

238+
if (mp->m_max_open_zones)
239+
seq_printf(m, ",max_open_zones=%u", mp->m_max_open_zones);
240+
237241
return 0;
238242
}
239243

@@ -1081,6 +1085,14 @@ xfs_finish_flags(
10811085
return -EINVAL;
10821086
}
10831087

1088+
if (!xfs_has_zoned(mp)) {
1089+
if (mp->m_max_open_zones) {
1090+
xfs_warn(mp,
1091+
"max_open_zones mount option only supported on zoned file systems.");
1092+
return -EINVAL;
1093+
}
1094+
}
1095+
10841096
return 0;
10851097
}
10861098

@@ -1463,6 +1475,9 @@ xfs_fs_parse_param(
14631475
xfs_fs_warn_deprecated(fc, param, XFS_FEAT_NOATTR2, true);
14641476
parsing_mp->m_features |= XFS_FEAT_NOATTR2;
14651477
return 0;
1478+
case Opt_max_open_zones:
1479+
parsing_mp->m_max_open_zones = result.uint_32;
1480+
return 0;
14661481
default:
14671482
xfs_warn(parsing_mp, "unknown mount option [%s].", param->key);
14681483
return -EINVAL;

0 commit comments

Comments
 (0)