aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 00:50:41 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:10 -0500
commit15169fe784a9846b24cdb0840329d41aebc23249 (patch)
treeef9e843dcd333204fd7fdca6d21fe96d0647da80 /fs/namespace.c
parent143c8c91cee7efdd732ec5f61b3471fc46192f20 (diff)
vfs: mnt_id/mnt_group_id moved
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 4cdb7f69861..dfed9a25f20 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -85,9 +85,9 @@ static int mnt_alloc_id(struct mount *mnt)
85retry: 85retry:
86 ida_pre_get(&mnt_id_ida, GFP_KERNEL); 86 ida_pre_get(&mnt_id_ida, GFP_KERNEL);
87 spin_lock(&mnt_id_lock); 87 spin_lock(&mnt_id_lock);
88 res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt.mnt_id); 88 res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt_id);
89 if (!res) 89 if (!res)
90 mnt_id_start = mnt->mnt.mnt_id + 1; 90 mnt_id_start = mnt->mnt_id + 1;
91 spin_unlock(&mnt_id_lock); 91 spin_unlock(&mnt_id_lock);
92 if (res == -EAGAIN) 92 if (res == -EAGAIN)
93 goto retry; 93 goto retry;
@@ -97,7 +97,7 @@ retry:
97 97
98static void mnt_free_id(struct mount *mnt) 98static void mnt_free_id(struct mount *mnt)
99{ 99{
100 int id = mnt->mnt.mnt_id; 100 int id = mnt->mnt_id;
101 spin_lock(&mnt_id_lock); 101 spin_lock(&mnt_id_lock);
102 ida_remove(&mnt_id_ida, id); 102 ida_remove(&mnt_id_ida, id);
103 if (mnt_id_start > id) 103 if (mnt_id_start > id)
@@ -119,9 +119,9 @@ static int mnt_alloc_group_id(struct mount *mnt)
119 119
120 res = ida_get_new_above(&mnt_group_ida, 120 res = ida_get_new_above(&mnt_group_ida,
121 mnt_group_start, 121 mnt_group_start,
122 &mnt->mnt.mnt_group_id); 122 &mnt->mnt_group_id);
123 if (!res) 123 if (!res)
124 mnt_group_start = mnt->mnt.mnt_group_id + 1; 124 mnt_group_start = mnt->mnt_group_id + 1;
125 125
126 return res; 126 return res;
127} 127}
@@ -131,11 +131,11 @@ static int mnt_alloc_group_id(struct mount *mnt)
131 */ 131 */
132void mnt_release_group_id(struct mount *mnt) 132void mnt_release_group_id(struct mount *mnt)
133{ 133{
134 int id = mnt->mnt.mnt_group_id; 134 int id = mnt->mnt_group_id;
135 ida_remove(&mnt_group_ida, id); 135 ida_remove(&mnt_group_ida, id);
136 if (mnt_group_start > id) 136 if (mnt_group_start > id)
137 mnt_group_start = id; 137 mnt_group_start = id;
138 mnt->mnt.mnt_group_id = 0; 138 mnt->mnt_group_id = 0;
139} 139}
140 140
141/* 141/*
@@ -696,11 +696,11 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
696 696
697 if (mnt) { 697 if (mnt) {
698 if (flag & (CL_SLAVE | CL_PRIVATE)) 698 if (flag & (CL_SLAVE | CL_PRIVATE))
699 mnt->mnt.mnt_group_id = 0; /* not a peer of original */ 699 mnt->mnt_group_id = 0; /* not a peer of original */
700 else 700 else
701 mnt->mnt.mnt_group_id = old->mnt.mnt_group_id; 701 mnt->mnt_group_id = old->mnt_group_id;
702 702
703 if ((flag & CL_MAKE_SHARED) && !mnt->mnt.mnt_group_id) { 703 if ((flag & CL_MAKE_SHARED) && !mnt->mnt_group_id) {
704 int err = mnt_alloc_group_id(mnt); 704 int err = mnt_alloc_group_id(mnt);
705 if (err) 705 if (err)
706 goto out_free; 706 goto out_free;
@@ -1029,7 +1029,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
1029 struct path root = p->root; 1029 struct path root = p->root;
1030 int err = 0; 1030 int err = 0;
1031 1031
1032 seq_printf(m, "%i %i %u:%u ", mnt->mnt_id, r->mnt_parent->mnt.mnt_id, 1032 seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id,
1033 MAJOR(sb->s_dev), MINOR(sb->s_dev)); 1033 MAJOR(sb->s_dev), MINOR(sb->s_dev));
1034 if (sb->s_op->show_path) 1034 if (sb->s_op->show_path)
1035 err = sb->s_op->show_path(m, mnt); 1035 err = sb->s_op->show_path(m, mnt);
@@ -1049,9 +1049,9 @@ static int show_mountinfo(struct seq_file *m, void *v)
1049 1049
1050 /* Tagged fields ("foo:X" or "bar") */ 1050 /* Tagged fields ("foo:X" or "bar") */
1051 if (IS_MNT_SHARED(mnt)) 1051 if (IS_MNT_SHARED(mnt))
1052 seq_printf(m, " shared:%i", mnt->mnt_group_id); 1052 seq_printf(m, " shared:%i", r->mnt_group_id);
1053 if (IS_MNT_SLAVE(r)) { 1053 if (IS_MNT_SLAVE(r)) {
1054 int master = r->mnt_master->mnt.mnt_group_id; 1054 int master = r->mnt_master->mnt_group_id;
1055 int dom = get_dominating_id(r, &p->root); 1055 int dom = get_dominating_id(r, &p->root);
1056 seq_printf(m, " master:%i", master); 1056 seq_printf(m, " master:%i", master);
1057 if (dom && dom != master) 1057 if (dom && dom != master)
@@ -1507,7 +1507,7 @@ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
1507 struct mount *p; 1507 struct mount *p;
1508 1508
1509 for (p = mnt; p != end; p = next_mnt(p, &mnt->mnt)) { 1509 for (p = mnt; p != end; p = next_mnt(p, &mnt->mnt)) {
1510 if (p->mnt.mnt_group_id && !IS_MNT_SHARED(&p->mnt)) 1510 if (p->mnt_group_id && !IS_MNT_SHARED(&p->mnt))
1511 mnt_release_group_id(p); 1511 mnt_release_group_id(p);
1512 } 1512 }
1513} 1513}
@@ -1517,7 +1517,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
1517 struct mount *p; 1517 struct mount *p;
1518 1518
1519 for (p = mnt; p; p = recurse ? next_mnt(p, &mnt->mnt) : NULL) { 1519 for (p = mnt; p; p = recurse ? next_mnt(p, &mnt->mnt) : NULL) {
1520 if (!p->mnt.mnt_group_id && !IS_MNT_SHARED(&p->mnt)) { 1520 if (!p->mnt_group_id && !IS_MNT_SHARED(&p->mnt)) {
1521 int err = mnt_alloc_group_id(p); 1521 int err = mnt_alloc_group_id(p);
1522 if (err) { 1522 if (err) {
1523 cleanup_group_ids(mnt, p); 1523 cleanup_group_ids(mnt, p);