]> git.ipfire.org Git - thirdparty/linux.git/commit
get rid of CL_SHARE_TO_SLAVE
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 25 Jun 2025 18:48:50 +0000 (14:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jun 2025 23:03:46 +0000 (19:03 -0400)
commit725ab435ff6e31faca26b8234f9f04c19f772b18
treed6c3473ea3f3271eb87c9ec768ea7edd13fbbac6
parentaab771f34e63ef89e195b63d121abcb55eebfde6
get rid of CL_SHARE_TO_SLAVE

the only difference between it and CL_SLAVE is in this predicate
in clone_mnt():
if ((flag & CL_SLAVE) ||
    ((flag & CL_SHARED_TO_SLAVE) && IS_MNT_SHARED(old))) {
However, in case of CL_SHARED_TO_SLAVE we have not allocated any
mount group ids since the time we'd grabbed namespace_sem, so
IS_MNT_SHARED() is equivalent to non-zero ->mnt_group_id.  And
in case of CL_SLAVE old has come either from the original tree,
which had ->mnt_group_id allocated for all nodes or from result
of sequence of CL_MAKE_SHARED or CL_MAKE_SHARED|CL_SLAVE copies,
ultimately going back to the original tree.  In both cases we are
guaranteed that old->mnt_group_id will be non-zero.

In other words, the predicate is always equal to
(flags & (CL_SLAVE | CL_SHARED_TO_SLAVE)) && old->mnt_group_id
and with that replacement CL_SLAVE and CL_SHARED_TO_SLAVE have exact
same behaviour.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c
fs/pnode.h