[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <101c5f3a-5614-47aa-8d62-c0b7d6baea5b@huaweicloud.com>
Date: Tue, 2 Dec 2025 09:12:43 +0800
From: Chen Ridong <chenridong@...weicloud.com>
To: tj@...nel.org, hannes@...xchg.org, mkoutny@...e.com
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
lujialin4@...wei.com, chenridong@...wei.com
Subject: Re: [PATCH -next] cgroup: Use descriptor table to unify mount flag
management
On 2025/11/26 10:08, Chen Ridong wrote:
> From: Chen Ridong <chenridong@...wei.com>
>
> The cgroup2 mount flags (e.g. nsdelegate, favordynmods) were previously
> handled via scattered switch-case and conditional checks across
> parameter parsing, flag application, and option display paths. This
> leads to redundant code and increased maintenance cost when adding/removing
> flags.
>
> Introduce a `cgroup_mount_flag_desc` descriptor table to centralize the
> mapping between flag bits, names, and apply functions. Refactor the
> relevant paths to use this table for unified management:
> 1. cgroup2_parse_param: Replace switch-case with table lookup
> 2. apply_cgroup_root_flags: Replace multiple conditionals with table
> iteration
> 3. cgroup_show_options: Replace hardcoded seq_puts with table-driven output
>
> No functional change intended, and the mount option output format remains
> compatible with the original implementation.
>
Hi all,
Would anyone be interested?
--
Best regards,
Ridong
Powered by blists - more mailing lists