aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 02:25:17 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:11 -0500
commit52ba1621de1479ce7e52b6d167860462e483313c (patch)
tree1609df395c437e8d2c0da30cace9a2b343ca0ad8 /fs
parent1a4eeaf2a8c07404e2d1c3ff99b393fd4c207170 (diff)
vfs: move mnt_devname
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/mount.h3
-rw-r--r--fs/namespace.c18
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/mount.h b/fs/mount.h
index 7060d2a6f802..c5fc3f7a9580 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -19,7 +19,8 @@ struct mount {
19#endif 19#endif
20 struct list_head mnt_mounts; /* list of children, anchored here */ 20 struct list_head mnt_mounts; /* list of children, anchored here */
21 struct list_head mnt_child; /* and going through their mnt_child */ 21 struct list_head mnt_child; /* and going through their mnt_child */
22 /* yet to be moved - up to mnt_devname */ 22 /* yet to be moved - fsnotify ones go here */
23 const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
23 struct list_head mnt_list; 24 struct list_head mnt_list;
24 struct list_head mnt_expire; /* link in fs-specific expiry list */ 25 struct list_head mnt_expire; /* link in fs-specific expiry list */
25 struct list_head mnt_share; /* circular list of shared mounts */ 26 struct list_head mnt_share; /* circular list of shared mounts */
diff --git a/fs/namespace.c b/fs/namespace.c
index e15125356ac1..b8a30928d0c1 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -183,8 +183,8 @@ static struct mount *alloc_vfsmnt(const char *name)
183 goto out_free_cache; 183 goto out_free_cache;
184 184
185 if (name) { 185 if (name) {
186 mnt->mnt_devname = kstrdup(name, GFP_KERNEL); 186 p->mnt_devname = kstrdup(name, GFP_KERNEL);
187 if (!mnt->mnt_devname) 187 if (!p->mnt_devname)
188 goto out_free_id; 188 goto out_free_id;
189 } 189 }
190 190
@@ -215,7 +215,7 @@ static struct mount *alloc_vfsmnt(const char *name)
215 215
216#ifdef CONFIG_SMP 216#ifdef CONFIG_SMP
217out_free_devname: 217out_free_devname:
218 kfree(p->mnt.mnt_devname); 218 kfree(p->mnt_devname);
219#endif 219#endif
220out_free_id: 220out_free_id:
221 mnt_free_id(p); 221 mnt_free_id(p);
@@ -451,7 +451,7 @@ static void __mnt_unmake_readonly(struct mount *mnt)
451 451
452static void free_vfsmnt(struct mount *mnt) 452static void free_vfsmnt(struct mount *mnt)
453{ 453{
454 kfree(mnt->mnt.mnt_devname); 454 kfree(mnt->mnt_devname);
455 mnt_free_id(mnt); 455 mnt_free_id(mnt);
456#ifdef CONFIG_SMP 456#ifdef CONFIG_SMP
457 free_percpu(mnt->mnt_pcp); 457 free_percpu(mnt->mnt_pcp);
@@ -692,7 +692,7 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
692 int flag) 692 int flag)
693{ 693{
694 struct super_block *sb = old->mnt.mnt_sb; 694 struct super_block *sb = old->mnt.mnt_sb;
695 struct mount *mnt = alloc_vfsmnt(old->mnt.mnt_devname); 695 struct mount *mnt = alloc_vfsmnt(old->mnt_devname);
696 696
697 if (mnt) { 697 if (mnt) {
698 if (flag & (CL_SLAVE | CL_PRIVATE)) 698 if (flag & (CL_SLAVE | CL_PRIVATE))
@@ -997,7 +997,7 @@ static int show_vfsmnt(struct seq_file *m, void *v)
997 if (err) 997 if (err)
998 goto out; 998 goto out;
999 } else { 999 } else {
1000 mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 1000 mangle(m, r->mnt_devname ? r->mnt_devname : "none");
1001 } 1001 }
1002 seq_putc(m, ' '); 1002 seq_putc(m, ' ');
1003 seq_path(m, &mnt_path, " \t\n\\"); 1003 seq_path(m, &mnt_path, " \t\n\\");
@@ -1070,7 +1070,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
1070 if (sb->s_op->show_devname) 1070 if (sb->s_op->show_devname)
1071 err = sb->s_op->show_devname(m, mnt); 1071 err = sb->s_op->show_devname(m, mnt);
1072 else 1072 else
1073 mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 1073 mangle(m, r->mnt_devname ? r->mnt_devname : "none");
1074 if (err) 1074 if (err)
1075 goto out; 1075 goto out;
1076 seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw"); 1076 seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw");
@@ -1103,9 +1103,9 @@ static int show_vfsstat(struct seq_file *m, void *v)
1103 seq_puts(m, "device "); 1103 seq_puts(m, "device ");
1104 err = mnt->mnt_sb->s_op->show_devname(m, mnt); 1104 err = mnt->mnt_sb->s_op->show_devname(m, mnt);
1105 } else { 1105 } else {
1106 if (mnt->mnt_devname) { 1106 if (r->mnt_devname) {
1107 seq_puts(m, "device "); 1107 seq_puts(m, "device ");
1108 mangle(m, mnt->mnt_devname); 1108 mangle(m, r->mnt_devname);
1109 } else 1109 } else
1110 seq_puts(m, "no device"); 1110 seq_puts(m, "no device");
1111 } 1111 }