aboutsummaryrefslogtreecommitdiffstats
path: root/fs/anon_inodes.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:27:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:27:28 -0500
commitb2034d474b7e1e8578bd5c2977024b51693269d9 (patch)
treee43969bf7c2ba89884c2580f56978826f1014520 /fs/anon_inodes.c
parent27d189c02ba25851973c8582e419c0bded9f7e5b (diff)
parent924241575a85249b9d410e38f5b2fcad9035e45c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (41 commits) fs: add documentation on fallocate hole punching Gfs2: fail if we try to use hole punch Btrfs: fail if we try to use hole punch Ext4: fail if we try to use hole punch Ocfs2: handle hole punching via fallocate properly XFS: handle hole punching via fallocate properly fs: add hole punching to fallocate vfs: pass struct file to do_truncate on O_TRUNC opens (try #2) fix signedness mess in rw_verify_area() on 64bit architectures fs: fix kernel-doc for dcache::prepend_path fs: fix kernel-doc for dcache::d_validate sanitize ecryptfs ->mount() switch afs move internal-only parts of ncpfs headers to fs/ncpfs switch ncpfs switch 9p pass default dentry_operations to mount_pseudo() switch hostfs switch affs switch configfs ...
Diffstat (limited to 'fs/anon_inodes.c')
-rw-r--r--fs/anon_inodes.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 98edb657b84d..cbe57f3c4d89 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;