• Pavel Tikhomirov's avatar
    mount: put all mounts which propagate from each other to a list · bc930d12
    Pavel Tikhomirov authored
    These information will help improving the restore of tricky mounts
    configurations.
    
    Function same_propagation_group checks if two mounts were created
    simultaneousely through shared mount propagation, and the main part of
    these - they should be in exaclty the same place inside the share of
    their parents.
    
    Function root_path_from_parent prints the mountpoint path
    relative to the root of the parent's share, by first substracting
    parent's mountpoint from our mountpoint and second prepending parents
    root path (relative to the root of it's file system), e.g:
    
    id	parent_id	root	mountpoint
    1	0		/	/
    2	1		/	/parent_a
    3	1		/dir	/parent_b
    4	2		/	/parent_a/dir/a
    5	3		/	/parent_b/a
    
    (Let 2 and 3 be a shared group)
    
    For mount 4 root_path_from_parent gives:
    "/parent_a/dir/a" - "/parent_a" == "/dir/a"
    "/" + "/dir/a" == "/dir/a"
    
    For mount 5:
    "/parent_b/a" - "/parent_b" == "/a"
    "/dir" + "/a" == "/dir/a"
    
    So mounts 4 and 5 are a propagation group.
    Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
    bc930d12
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...