propagate_one(): get rid of dest_master
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 21 Jun 2025 21:41:40 +0000 (17:41 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jun 2025 23:03:29 +0000 (19:03 -0400)
commit25776a09d802f4e4d8c0bd72042934223286c2e3
tree444d5ee745c80ce5c17a0dae7611b51f7ec0a31c
parent406fea79992561f47fd3511dd8b7c8abeeff7045
propagate_one(): get rid of dest_master

propagate_mnt() takes the subtree we are about to attach and creates
its copies, setting the propagation between those.  Each copy is cloned
either from the original or from one of the already created copies.
The tricky part is choosing the right copy to serve as a master when we
are starting a new peer group.

The algorithm for doing that selection puts temporary marks on the masters
of mountpoints that already got a copy created for them; since the initial
peer group might have no master at all, we need to special-case that when
looking for the mark.  Currently we do that by memorizing the master of
original peer group.  It works, but we get yet another piece of data to
pass from propagate_mnt() to propagate_one().

Alternative is to mark the master of original peer group if not NULL,
turning the check into "master is NULL or marked".  Less data to pass
around and memory safety is more obvious that way...

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