fs: convert mount flags to enum
authorStephen Brennan <stephen.s.brennan@oracle.com>
Wed, 7 May 2025 22:34:01 +0000 (15:34 -0700)
committerChristian Brauner <brauner@kernel.org>
Fri, 23 May 2025 12:20:44 +0000 (14:20 +0200)
commit101f2bbab541116ab861b9c3ac0ece07a7eaa756
tree2715431e22f6a5b4417d6af5f67b0150e03a2107
parent7fc711739eb8c30955fd8a85be0db7d5a0aa10ae
fs: convert mount flags to enum

In prior kernel versions (5.8-6.8), commit 9f6c61f96f2d9 ("proc/mounts:
add cursor") introduced MNT_CURSOR, a flag used by readers from
/proc/mounts to keep their place while reading the file. Later, commit
2eea9ce4310d8 ("mounts: keep list of mounts in an rbtree") removed this
flag and its value has since been repurposed.

For debuggers iterating over the list of mounts, cursors should be
skipped as they are irrelevant. Detecting whether an element is a cursor
can be difficult. Since the MNT_CURSOR flag is a preprocessor constant,
it's not present in debuginfo, and since its value is repurposed, we
cannot hard-code it. For this specific issue, cursors are possible to
detect in other ways, but ideally, we would be able to read the mount
flag definitions out of the debuginfo. For that reason, convert the
mount flags to an enum.

Link: https://github.com/osandov/drgn/pull/496
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Link: https://lore.kernel.org/20250507223402.2795029-1-stephen.s.brennan@oracle.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/mount.h