aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-01-12 16:59:34 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-12 20:03:43 -0500
commitc74a1cbb3cac348f276fabc381758f5b0b4713b2 (patch)
tree5b403590e41b5e91fce25c69d50a23b920b3497f /fs
parentf772c4a6a320ec25d94ba951881474eeef1b7f48 (diff)
pass default dentry_operations to mount_pseudo()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/anon_inodes.c21
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/libfs.c4
-rw-r--r--fs/pipe.c4
4 files changed, 17 insertions, 14 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 5fd38112a6ca..549a53cc0283 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -26,12 +26,6 @@ static struct vfsmount *anon_inode_mnt __read_mostly;
26static struct inode *anon_inode_inode; 26static struct inode *anon_inode_inode;
27static const struct file_operations anon_inode_fops; 27static const struct file_operations anon_inode_fops;
28 28
29static struct dentry *anon_inodefs_mount(struct file_system_type *fs_type,
30 int flags, const char *dev_name, void *data)
31{
32 return mount_pseudo(fs_type, "anon_inode:", NULL, ANON_INODE_FS_MAGIC);
33}
34
35/* 29/*
36 * anon_inodefs_dname() is called from d_path(). 30 * anon_inodefs_dname() is called from d_path().
37 */ 31 */
@@ -41,14 +35,22 @@ static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen)
41 dentry->d_name.name); 35 dentry->d_name.name);
42} 36}
43 37
38static const struct dentry_operations anon_inodefs_dentry_operations = {
39 .d_dname = anon_inodefs_dname,
40};
41
42static struct dentry *anon_inodefs_mount(struct file_system_type *fs_type,
43 int flags, const char *dev_name, void *data)
44{
45 return mount_pseudo(fs_type, "anon_inode:", NULL,
46 &anon_inodefs_dentry_operations, ANON_INODE_FS_MAGIC);
47}
48
44static struct file_system_type anon_inode_fs_type = { 49static struct file_system_type anon_inode_fs_type = {
45 .name = "anon_inodefs", 50 .name = "anon_inodefs",
46 .mount = anon_inodefs_mount, 51 .mount = anon_inodefs_mount,
47 .kill_sb = kill_anon_super, 52 .kill_sb = kill_anon_super,
48}; 53};
49static const struct dentry_operations anon_inodefs_dentry_operations = {
50 .d_dname = anon_inodefs_dname,
51};
52 54
53/* 55/*
54 * nop .set_page_dirty method so that people can use .page_mkwrite on 56 * nop .set_page_dirty method so that people can use .page_mkwrite on
@@ -113,7 +115,6 @@ struct file *anon_inode_getfile(const char *name,
113 */ 115 */
114 ihold(anon_inode_inode); 116 ihold(anon_inode_inode);
115 117
116 d_set_d_op(path.dentry, &anon_inodefs_dentry_operations);
117 d_instantiate(path.dentry, anon_inode_inode); 118 d_instantiate(path.dentry, anon_inode_inode);
118 119
119 error = -ENFILE; 120 error = -ENFILE;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 771f23527010..88da70355aa3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -473,7 +473,7 @@ static const struct super_operations bdev_sops = {
473static struct dentry *bd_mount(struct file_system_type *fs_type, 473static struct dentry *bd_mount(struct file_system_type *fs_type,
474 int flags, const char *dev_name, void *data) 474 int flags, const char *dev_name, void *data)
475{ 475{
476 return mount_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576); 476 return mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, 0x62646576);
477} 477}
478 478
479static struct file_system_type bd_type = { 479static struct file_system_type bd_type = {
diff --git a/fs/libfs.c b/fs/libfs.c
index 889311e3d06b..c88eab55aec9 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -217,7 +217,8 @@ static const struct super_operations simple_super_operations = {
217 * will never be mountable) 217 * will never be mountable)
218 */ 218 */
219struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name, 219struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
220 const struct super_operations *ops, unsigned long magic) 220 const struct super_operations *ops,
221 const struct dentry_operations *dops, unsigned long magic)
221{ 222{
222 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); 223 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
223 struct dentry *dentry; 224 struct dentry *dentry;
@@ -254,6 +255,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
254 dentry->d_parent = dentry; 255 dentry->d_parent = dentry;
255 d_instantiate(dentry, root); 256 d_instantiate(dentry, root);
256 s->s_root = dentry; 257 s->s_root = dentry;
258 s->s_d_op = dops;
257 s->s_flags |= MS_ACTIVE; 259 s->s_flags |= MS_ACTIVE;
258 return dget(s->s_root); 260 return dget(s->s_root);
259 261
diff --git a/fs/pipe.c b/fs/pipe.c
index 68f1f8e4e23b..6b0255a74f36 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1004,7 +1004,6 @@ struct file *create_write_pipe(int flags)
1004 goto err_inode; 1004 goto err_inode;
1005 path.mnt = mntget(pipe_mnt); 1005 path.mnt = mntget(pipe_mnt);
1006 1006
1007 d_set_d_op(path.dentry, &pipefs_dentry_operations);
1008 d_instantiate(path.dentry, inode); 1007 d_instantiate(path.dentry, inode);
1009 1008
1010 err = -ENFILE; 1009 err = -ENFILE;
@@ -1266,7 +1265,8 @@ static const struct super_operations pipefs_ops = {
1266static struct dentry *pipefs_mount(struct file_system_type *fs_type, 1265static struct dentry *pipefs_mount(struct file_system_type *fs_type,
1267 int flags, const char *dev_name, void *data) 1266 int flags, const char *dev_name, void *data)
1268{ 1267{
1269 return mount_pseudo(fs_type, "pipe:", &pipefs_ops, PIPEFS_MAGIC); 1268 return mount_pseudo(fs_type, "pipe:", &pipefs_ops,
1269 &pipefs_dentry_operations, PIPEFS_MAGIC);
1270} 1270}
1271 1271
1272static struct file_system_type pipe_fs_type = { 1272static struct file_system_type pipe_fs_type = {