aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/kernel/perfmon.c6
-rw-r--r--drivers/mtd/mtdchar.c2
-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
-rw-r--r--include/linux/fs.h4
-rw-r--r--net/socket.c30
8 files changed, 40 insertions, 33 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index d92d5b5161fc..ac76da099a6d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -617,11 +617,14 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
617 return get_unmapped_area(file, addr, len, pgoff, flags); 617 return get_unmapped_area(file, addr, len, pgoff, flags);
618} 618}
619 619
620/* forward declaration */
621static static const struct dentry_operations pfmfs_dentry_operations;
620 622
621static struct dentry * 623static struct dentry *
622pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) 624pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
623{ 625{
624 return mount_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC); 626 return mount_pseudo(fs_type, "pfm:", NULL, &pfmfs_dentry_operations,
627 PFMFS_MAGIC);
625} 628}
626 629
627static struct file_system_type pfm_fs_type = { 630static struct file_system_type pfm_fs_type = {
@@ -2232,7 +2235,6 @@ pfm_alloc_file(pfm_context_t *ctx)
2232 } 2235 }
2233 path.mnt = mntget(pfmfs_mnt); 2236 path.mnt = mntget(pfmfs_mnt);
2234 2237
2235 d_set_d_op(path.dentry, &pfmfs_dentry_operations);
2236 d_add(path.dentry, inode); 2238 d_add(path.dentry, inode);
2237 2239
2238 file = alloc_file(&path, FMODE_READ, &pfm_file_ops); 2240 file = alloc_file(&path, FMODE_READ, &pfm_file_ops);
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index f511dd15fd31..ee4bb3330bdf 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -1134,7 +1134,7 @@ static const struct file_operations mtd_fops = {
1134static struct dentry *mtd_inodefs_mount(struct file_system_type *fs_type, 1134static struct dentry *mtd_inodefs_mount(struct file_system_type *fs_type,
1135 int flags, const char *dev_name, void *data) 1135 int flags, const char *dev_name, void *data)
1136{ 1136{
1137 return mount_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC); 1137 return mount_pseudo(fs_type, "mtd_inode:", NULL, NULL, MTD_INODE_FS_MAGIC);
1138} 1138}
1139 1139
1140static struct file_system_type mtd_inodefs_type = { 1140static struct file_system_type mtd_inodefs_type = {
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 = {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3e4c27486e74..c0701288d204 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1835,7 +1835,9 @@ struct super_block *sget(struct file_system_type *type,
1835 int (*set)(struct super_block *,void *), 1835 int (*set)(struct super_block *,void *),
1836 void *data); 1836 void *data);
1837extern struct dentry *mount_pseudo(struct file_system_type *, char *, 1837extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1838 const struct super_operations *ops, unsigned long); 1838 const struct super_operations *ops,
1839 const struct dentry_operations *dops,
1840 unsigned long);
1839extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1841extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1840 1842
1841static inline void sb_mark_dirty(struct super_block *sb) 1843static inline void sb_mark_dirty(struct super_block *sb)
diff --git a/net/socket.c b/net/socket.c
index ccc576a6a508..ac2219f90d5d 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -306,20 +306,6 @@ static const struct super_operations sockfs_ops = {
306 .statfs = simple_statfs, 306 .statfs = simple_statfs,
307}; 307};
308 308
309static struct dentry *sockfs_mount(struct file_system_type *fs_type,
310 int flags, const char *dev_name, void *data)
311{
312 return mount_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC);
313}
314
315static struct vfsmount *sock_mnt __read_mostly;
316
317static struct file_system_type sock_fs_type = {
318 .name = "sockfs",
319 .mount = sockfs_mount,
320 .kill_sb = kill_anon_super,
321};
322
323/* 309/*
324 * sockfs_dname() is called from d_path(). 310 * sockfs_dname() is called from d_path().
325 */ 311 */
@@ -333,6 +319,21 @@ static const struct dentry_operations sockfs_dentry_operations = {
333 .d_dname = sockfs_dname, 319 .d_dname = sockfs_dname,
334}; 320};
335 321
322static struct dentry *sockfs_mount(struct file_system_type *fs_type,
323 int flags, const char *dev_name, void *data)
324{
325 return mount_pseudo(fs_type, "socket:", &sockfs_ops,
326 &sockfs_dentry_operations, SOCKFS_MAGIC);
327}
328
329static struct vfsmount *sock_mnt __read_mostly;
330
331static struct file_system_type sock_fs_type = {
332 .name = "sockfs",
333 .mount = sockfs_mount,
334 .kill_sb = kill_anon_super,
335};
336
336/* 337/*
337 * Obtains the first available file descriptor and sets it up for use. 338 * Obtains the first available file descriptor and sets it up for use.
338 * 339 *
@@ -368,7 +369,6 @@ static int sock_alloc_file(struct socket *sock, struct file **f, int flags)
368 } 369 }
369 path.mnt = mntget(sock_mnt); 370 path.mnt = mntget(sock_mnt);
370 371
371 d_set_d_op(path.dentry, &sockfs_dentry_operations);
372 d_instantiate(path.dentry, SOCK_INODE(sock)); 372 d_instantiate(path.dentry, SOCK_INODE(sock));
373 SOCK_INODE(sock)->i_fop = &socket_file_ops; 373 SOCK_INODE(sock)->i_fop = &socket_file_ops;
374 374