aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 01:05:37 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:11 -0500
commitfc7be130c7e91cf693d4bc2d9b11f08a5a4893d0 (patch)
tree8df38871ffccd0e977702d61691967c184fabecc /fs/namespace.c
parent863d684f946eb240c7dd57d265d88315950ca5cc (diff)
vfs: switch pnode.h macros to struct mount *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index c7b8dbc88fe5..bbe24defcac7 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -716,9 +716,9 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
716 if (flag & CL_SLAVE) { 716 if (flag & CL_SLAVE) {
717 list_add(&mnt->mnt_slave, &old->mnt_slave_list); 717 list_add(&mnt->mnt_slave, &old->mnt_slave_list);
718 mnt->mnt_master = old; 718 mnt->mnt_master = old;
719 CLEAR_MNT_SHARED(&mnt->mnt); 719 CLEAR_MNT_SHARED(mnt);
720 } else if (!(flag & CL_PRIVATE)) { 720 } else if (!(flag & CL_PRIVATE)) {
721 if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(&old->mnt)) 721 if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(old))
722 list_add(&mnt->mnt_share, &old->mnt_share); 722 list_add(&mnt->mnt_share, &old->mnt_share);
723 if (IS_MNT_SLAVE(old)) 723 if (IS_MNT_SLAVE(old))
724 list_add(&mnt->mnt_slave, &old->mnt_slave); 724 list_add(&mnt->mnt_slave, &old->mnt_slave);
@@ -1050,7 +1050,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
1050 show_mnt_opts(m, mnt); 1050 show_mnt_opts(m, mnt);
1051 1051
1052 /* Tagged fields ("foo:X" or "bar") */ 1052 /* Tagged fields ("foo:X" or "bar") */
1053 if (IS_MNT_SHARED(mnt)) 1053 if (IS_MNT_SHARED(r))
1054 seq_printf(m, " shared:%i", r->mnt_group_id); 1054 seq_printf(m, " shared:%i", r->mnt_group_id);
1055 if (IS_MNT_SLAVE(r)) { 1055 if (IS_MNT_SLAVE(r)) {
1056 int master = r->mnt_master->mnt_group_id; 1056 int master = r->mnt_master->mnt_group_id;
@@ -1059,7 +1059,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
1059 if (dom && dom != master) 1059 if (dom && dom != master)
1060 seq_printf(m, " propagate_from:%i", dom); 1060 seq_printf(m, " propagate_from:%i", dom);
1061 } 1061 }
1062 if (IS_MNT_UNBINDABLE(mnt)) 1062 if (IS_MNT_UNBINDABLE(r))
1063 seq_puts(m, " unbindable"); 1063 seq_puts(m, " unbindable");
1064 1064
1065 /* Filesystem specific data */ 1065 /* Filesystem specific data */
@@ -1421,7 +1421,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
1421 struct mount *res, *p, *q, *r; 1421 struct mount *res, *p, *q, *r;
1422 struct path path; 1422 struct path path;
1423 1423
1424 if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(&mnt->mnt)) 1424 if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(mnt))
1425 return NULL; 1425 return NULL;
1426 1426
1427 res = q = clone_mnt(mnt, dentry, flag); 1427 res = q = clone_mnt(mnt, dentry, flag);
@@ -1436,7 +1436,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
1436 continue; 1436 continue;
1437 1437
1438 for (s = r; s; s = next_mnt(s, &r->mnt)) { 1438 for (s = r; s; s = next_mnt(s, &r->mnt)) {
1439 if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(&s->mnt)) { 1439 if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(s)) {
1440 s = skip_mnt_tree(s); 1440 s = skip_mnt_tree(s);
1441 continue; 1441 continue;
1442 } 1442 }
@@ -1509,7 +1509,7 @@ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
1509 struct mount *p; 1509 struct mount *p;
1510 1510
1511 for (p = mnt; p != end; p = next_mnt(p, &mnt->mnt)) { 1511 for (p = mnt; p != end; p = next_mnt(p, &mnt->mnt)) {
1512 if (p->mnt_group_id && !IS_MNT_SHARED(&p->mnt)) 1512 if (p->mnt_group_id && !IS_MNT_SHARED(p))
1513 mnt_release_group_id(p); 1513 mnt_release_group_id(p);
1514 } 1514 }
1515} 1515}
@@ -1519,7 +1519,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
1519 struct mount *p; 1519 struct mount *p;
1520 1520
1521 for (p = mnt; p; p = recurse ? next_mnt(p, &mnt->mnt) : NULL) { 1521 for (p = mnt; p; p = recurse ? next_mnt(p, &mnt->mnt) : NULL) {
1522 if (!p->mnt_group_id && !IS_MNT_SHARED(&p->mnt)) { 1522 if (!p->mnt_group_id && !IS_MNT_SHARED(p)) {
1523 int err = mnt_alloc_group_id(p); 1523 int err = mnt_alloc_group_id(p);
1524 if (err) { 1524 if (err) {
1525 cleanup_group_ids(mnt, p); 1525 cleanup_group_ids(mnt, p);
@@ -1603,7 +1603,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
1603 struct mount *child, *p; 1603 struct mount *child, *p;
1604 int err; 1604 int err;
1605 1605
1606 if (IS_MNT_SHARED(&dest_mnt->mnt)) { 1606 if (IS_MNT_SHARED(dest_mnt)) {
1607 err = invent_group_ids(source_mnt, true); 1607 err = invent_group_ids(source_mnt, true);
1608 if (err) 1608 if (err)
1609 goto out; 1609 goto out;
@@ -1614,7 +1614,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
1614 1614
1615 br_write_lock(vfsmount_lock); 1615 br_write_lock(vfsmount_lock);
1616 1616
1617 if (IS_MNT_SHARED(&dest_mnt->mnt)) { 1617 if (IS_MNT_SHARED(dest_mnt)) {
1618 for (p = source_mnt; p; p = next_mnt(p, &source_mnt->mnt)) 1618 for (p = source_mnt; p; p = next_mnt(p, &source_mnt->mnt))
1619 set_mnt_shared(p); 1619 set_mnt_shared(p);
1620 } 1620 }
@@ -1636,7 +1636,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
1636 return 0; 1636 return 0;
1637 1637
1638 out_cleanup_ids: 1638 out_cleanup_ids:
1639 if (IS_MNT_SHARED(&dest_mnt->mnt)) 1639 if (IS_MNT_SHARED(dest_mnt))
1640 cleanup_group_ids(source_mnt, NULL); 1640 cleanup_group_ids(source_mnt, NULL);
1641 out: 1641 out:
1642 return err; 1642 return err;
@@ -1764,7 +1764,7 @@ static int do_loopback(struct path *path, char *old_name,
1764 old = real_mount(old_path.mnt); 1764 old = real_mount(old_path.mnt);
1765 1765
1766 err = -EINVAL; 1766 err = -EINVAL;
1767 if (IS_MNT_UNBINDABLE(old_path.mnt)) 1767 if (IS_MNT_UNBINDABLE(old))
1768 goto out2; 1768 goto out2;
1769 1769
1770 if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old)) 1770 if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old))
@@ -1859,7 +1859,7 @@ static inline int tree_contains_unbindable(struct mount *mnt)
1859{ 1859{
1860 struct mount *p; 1860 struct mount *p;
1861 for (p = mnt; p; p = next_mnt(p, &mnt->mnt)) { 1861 for (p = mnt; p; p = next_mnt(p, &mnt->mnt)) {
1862 if (IS_MNT_UNBINDABLE(&p->mnt)) 1862 if (IS_MNT_UNBINDABLE(p))
1863 return 1; 1863 return 1;
1864 } 1864 }
1865 return 0; 1865 return 0;
@@ -1884,9 +1884,10 @@ static int do_move_mount(struct path *path, char *old_name)
1884 goto out; 1884 goto out;
1885 1885
1886 old = real_mount(old_path.mnt); 1886 old = real_mount(old_path.mnt);
1887 p = real_mount(path->mnt);
1887 1888
1888 err = -EINVAL; 1889 err = -EINVAL;
1889 if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old)) 1890 if (!check_mnt(p) || !check_mnt(old))
1890 goto out1; 1891 goto out1;
1891 1892
1892 if (d_unlinked(path->dentry)) 1893 if (d_unlinked(path->dentry))
@@ -1905,17 +1906,16 @@ static int do_move_mount(struct path *path, char *old_name)
1905 /* 1906 /*
1906 * Don't move a mount residing in a shared parent. 1907 * Don't move a mount residing in a shared parent.
1907 */ 1908 */
1908 if (IS_MNT_SHARED(&old->mnt_parent->mnt)) 1909 if (IS_MNT_SHARED(old->mnt_parent))
1909 goto out1; 1910 goto out1;
1910 /* 1911 /*
1911 * Don't move a mount tree containing unbindable mounts to a destination 1912 * Don't move a mount tree containing unbindable mounts to a destination
1912 * mount which is shared. 1913 * mount which is shared.
1913 */ 1914 */
1914 if (IS_MNT_SHARED(path->mnt) && 1915 if (IS_MNT_SHARED(p) && tree_contains_unbindable(old))
1915 tree_contains_unbindable(old))
1916 goto out1; 1916 goto out1;
1917 err = -ELOOP; 1917 err = -ELOOP;
1918 for (p = real_mount(path->mnt); mnt_has_parent(p); p = p->mnt_parent) 1918 for (; mnt_has_parent(p); p = p->mnt_parent)
1919 if (p == old) 1919 if (p == old)
1920 goto out1; 1920 goto out1;
1921 1921
@@ -2643,9 +2643,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
2643 error = -EINVAL; 2643 error = -EINVAL;
2644 new_mnt = real_mount(new.mnt); 2644 new_mnt = real_mount(new.mnt);
2645 root_mnt = real_mount(root.mnt); 2645 root_mnt = real_mount(root.mnt);
2646 if (IS_MNT_SHARED(old.mnt) || 2646 if (IS_MNT_SHARED(real_mount(old.mnt)) ||
2647 IS_MNT_SHARED(&new_mnt->mnt_parent->mnt) || 2647 IS_MNT_SHARED(new_mnt->mnt_parent) ||
2648 IS_MNT_SHARED(&root_mnt->mnt_parent->mnt)) 2648 IS_MNT_SHARED(root_mnt->mnt_parent))
2649 goto out4; 2649 goto out4;
2650 if (!check_mnt(root_mnt) || !check_mnt(new_mnt)) 2650 if (!check_mnt(root_mnt) || !check_mnt(new_mnt))
2651 goto out4; 2651 goto out4;