]> git.ipfire.org Git - thirdparty/linux.git/commit
change calling conventions for lock_mount() et.al.
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Aug 2025 17:42:24 +0000 (13:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:23:59 +0000 (21:23 -0400)
commit2010464cfafb22821e39c216cb068d83c91d7d8b
treebdcc80b99bbcc67aebfaed9674f0098df7db2206
parentf1f486b841c73e94167956e1885f865cac4e629f
change calling conventions for lock_mount() et.al.

1) pinned_mountpoint gets a new member - struct mount *parent.
Set only if we locked the sucker; ERR_PTR() - on failed attempt.

2) do_lock_mount() et.al. return void and set ->parent to
* on success with !beneath - mount corresponding to path->mnt
* on success with beneath - the parent of mount corresponding
to path->mnt
* in case of error - ERR_PTR(-E...).
IOW, we get the mount we will be actually mounting upon or ERR_PTR().

3) we can't use CLASS, since the pinned_mountpoint is placed on
hlist during initialization, so we define local macros:
LOCK_MOUNT(mp, path)
LOCK_MOUNT_MAYBE_BENEATH(mp, path, beneath)
LOCK_MOUNT_EXACT(mp, path)
All of them declare and initialize struct pinned_mountpoint mp,
with unlock_mount done via __cleanup().

Users converted.

[
lock_mount() is unused now; removed.
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
]

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c