vfs: switch pnode.h macros to struct mount *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/namespace.c b/fs/namespace.c
index c7b8dbc..bbe24de 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -716,9 +716,9 @@
if (flag & CL_SLAVE) {
list_add(&mnt->mnt_slave, &old->mnt_slave_list);
mnt->mnt_master = old;
- CLEAR_MNT_SHARED(&mnt->mnt);
+ CLEAR_MNT_SHARED(mnt);
} else if (!(flag & CL_PRIVATE)) {
- if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(&old->mnt))
+ if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(old))
list_add(&mnt->mnt_share, &old->mnt_share);
if (IS_MNT_SLAVE(old))
list_add(&mnt->mnt_slave, &old->mnt_slave);
@@ -1050,7 +1050,7 @@
show_mnt_opts(m, mnt);
/* Tagged fields ("foo:X" or "bar") */
- if (IS_MNT_SHARED(mnt))
+ if (IS_MNT_SHARED(r))
seq_printf(m, " shared:%i", r->mnt_group_id);
if (IS_MNT_SLAVE(r)) {
int master = r->mnt_master->mnt_group_id;
@@ -1059,7 +1059,7 @@
if (dom && dom != master)
seq_printf(m, " propagate_from:%i", dom);
}
- if (IS_MNT_UNBINDABLE(mnt))
+ if (IS_MNT_UNBINDABLE(r))
seq_puts(m, " unbindable");
/* Filesystem specific data */
@@ -1421,7 +1421,7 @@
struct mount *res, *p, *q, *r;
struct path path;
- if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(&mnt->mnt))
+ if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(mnt))
return NULL;
res = q = clone_mnt(mnt, dentry, flag);
@@ -1436,7 +1436,7 @@
continue;
for (s = r; s; s = next_mnt(s, &r->mnt)) {
- if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(&s->mnt)) {
+ if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(s)) {
s = skip_mnt_tree(s);
continue;
}
@@ -1509,7 +1509,7 @@
struct mount *p;
for (p = mnt; p != end; p = next_mnt(p, &mnt->mnt)) {
- if (p->mnt_group_id && !IS_MNT_SHARED(&p->mnt))
+ if (p->mnt_group_id && !IS_MNT_SHARED(p))
mnt_release_group_id(p);
}
}
@@ -1519,7 +1519,7 @@
struct mount *p;
for (p = mnt; p; p = recurse ? next_mnt(p, &mnt->mnt) : NULL) {
- if (!p->mnt_group_id && !IS_MNT_SHARED(&p->mnt)) {
+ if (!p->mnt_group_id && !IS_MNT_SHARED(p)) {
int err = mnt_alloc_group_id(p);
if (err) {
cleanup_group_ids(mnt, p);
@@ -1603,7 +1603,7 @@
struct mount *child, *p;
int err;
- if (IS_MNT_SHARED(&dest_mnt->mnt)) {
+ if (IS_MNT_SHARED(dest_mnt)) {
err = invent_group_ids(source_mnt, true);
if (err)
goto out;
@@ -1614,7 +1614,7 @@
br_write_lock(vfsmount_lock);
- if (IS_MNT_SHARED(&dest_mnt->mnt)) {
+ if (IS_MNT_SHARED(dest_mnt)) {
for (p = source_mnt; p; p = next_mnt(p, &source_mnt->mnt))
set_mnt_shared(p);
}
@@ -1636,7 +1636,7 @@
return 0;
out_cleanup_ids:
- if (IS_MNT_SHARED(&dest_mnt->mnt))
+ if (IS_MNT_SHARED(dest_mnt))
cleanup_group_ids(source_mnt, NULL);
out:
return err;
@@ -1764,7 +1764,7 @@
old = real_mount(old_path.mnt);
err = -EINVAL;
- if (IS_MNT_UNBINDABLE(old_path.mnt))
+ if (IS_MNT_UNBINDABLE(old))
goto out2;
if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old))
@@ -1859,7 +1859,7 @@
{
struct mount *p;
for (p = mnt; p; p = next_mnt(p, &mnt->mnt)) {
- if (IS_MNT_UNBINDABLE(&p->mnt))
+ if (IS_MNT_UNBINDABLE(p))
return 1;
}
return 0;
@@ -1884,9 +1884,10 @@
goto out;
old = real_mount(old_path.mnt);
+ p = real_mount(path->mnt);
err = -EINVAL;
- if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old))
+ if (!check_mnt(p) || !check_mnt(old))
goto out1;
if (d_unlinked(path->dentry))
@@ -1905,17 +1906,16 @@
/*
* Don't move a mount residing in a shared parent.
*/
- if (IS_MNT_SHARED(&old->mnt_parent->mnt))
+ if (IS_MNT_SHARED(old->mnt_parent))
goto out1;
/*
* Don't move a mount tree containing unbindable mounts to a destination
* mount which is shared.
*/
- if (IS_MNT_SHARED(path->mnt) &&
- tree_contains_unbindable(old))
+ if (IS_MNT_SHARED(p) && tree_contains_unbindable(old))
goto out1;
err = -ELOOP;
- for (p = real_mount(path->mnt); mnt_has_parent(p); p = p->mnt_parent)
+ for (; mnt_has_parent(p); p = p->mnt_parent)
if (p == old)
goto out1;
@@ -2643,9 +2643,9 @@
error = -EINVAL;
new_mnt = real_mount(new.mnt);
root_mnt = real_mount(root.mnt);
- if (IS_MNT_SHARED(old.mnt) ||
- IS_MNT_SHARED(&new_mnt->mnt_parent->mnt) ||
- IS_MNT_SHARED(&root_mnt->mnt_parent->mnt))
+ if (IS_MNT_SHARED(real_mount(old.mnt)) ||
+ IS_MNT_SHARED(new_mnt->mnt_parent) ||
+ IS_MNT_SHARED(root_mnt->mnt_parent))
goto out4;
if (!check_mnt(root_mnt) || !check_mnt(new_mnt))
goto out4;
diff --git a/fs/pnode.c b/fs/pnode.c
index a40abf2..ab5fa9e 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -82,7 +82,7 @@
if (peer_mnt == mnt)
peer_mnt = NULL;
}
- if (IS_MNT_SHARED(&mnt->mnt) && list_empty(&mnt->mnt_share))
+ if (IS_MNT_SHARED(mnt) && list_empty(&mnt->mnt_share))
mnt_release_group_id(mnt);
list_del_init(&mnt->mnt_share);
@@ -107,7 +107,7 @@
}
}
mnt->mnt_master = master;
- CLEAR_MNT_SHARED(&mnt->mnt);
+ CLEAR_MNT_SHARED(mnt);
return 0;
}
@@ -199,7 +199,7 @@
/* slave of the earlier, then */
*type = CL_SLAVE;
/* beginning of peer group among the slaves? */
- if (IS_MNT_SHARED(&dest->mnt))
+ if (IS_MNT_SHARED(dest))
*type |= CL_MAKE_SHARED;
return last_src;
}
diff --git a/fs/pnode.h b/fs/pnode.h
index 54deeda..65c6097 100644
--- a/fs/pnode.h
+++ b/fs/pnode.h
@@ -11,11 +11,11 @@
#include <linux/list.h>
#include "mount.h"
-#define IS_MNT_SHARED(mnt) ((mnt)->mnt_flags & MNT_SHARED)
-#define IS_MNT_SLAVE(mnt) ((mnt)->mnt_master)
-#define IS_MNT_NEW(mnt) (!(mnt)->mnt_ns)
-#define CLEAR_MNT_SHARED(mnt) ((mnt)->mnt_flags &= ~MNT_SHARED)
-#define IS_MNT_UNBINDABLE(mnt) ((mnt)->mnt_flags & MNT_UNBINDABLE)
+#define IS_MNT_SHARED(m) ((m)->mnt.mnt_flags & MNT_SHARED)
+#define IS_MNT_SLAVE(m) ((m)->mnt_master)
+#define IS_MNT_NEW(m) (!(m)->mnt_ns)
+#define CLEAR_MNT_SHARED(m) ((m)->mnt.mnt_flags &= ~MNT_SHARED)
+#define IS_MNT_UNBINDABLE(m) ((m)->mnt.mnt_flags & MNT_UNBINDABLE)
#define CL_EXPIRE 0x01
#define CL_SLAVE 0x02