aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-16 18:53:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-16 18:53:03 -0500
commit603ba7e41bf5d405aba22294af5d075d8898176d (patch)
treefb9cf0b7c4912b5105f7da5efdd204cd0e66c8db /fs/inode.c
parent31f48fc8f226f968d6e6b9b9718abe8e16c51fe8 (diff)
parent93fe74b2e2b5d266d630f0c3f8287efcbe6ecd10 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile #2 from Al Viro: "Next pile (and there'll be one or two more). The large piece in this one is getting rid of /proc/*/ns/* weirdness; among other things, it allows to (finally) make nameidata completely opaque outside of fs/namei.c, making for easier further cleanups in there" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: coda_venus_readdir(): use file_inode() fs/namei.c: fold link_path_walk() call into path_init() path_init(): don't bother with LOOKUP_PARENT in argument fs/namei.c: new helper (path_cleanup()) path_init(): store the "base" pointer to file in nameidata itself make default ->i_fop have ->open() fail with ENXIO make nameidata completely opaque outside of fs/namei.c kill proc_ns completely take the targets of /proc/*/ns/* symlinks to separate fs bury struct proc_ns in fs/proc copy address of proc_ns_ops into ns_common new helpers: ns_alloc_inum/ns_free_inum make proc_ns_operations work with struct ns_common * instead of void * switch the rest of proc_ns_operations to working with &...->ns netns: switch ->get()/->put()/->install()/->inum() to working with &net->ns make mntns ->get()/->put()/->install()/->inum() work with &mnt_ns->ns common object embedded into various struct ....ns
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c
index ad60555b4768..aa149e7262ac 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -114,6 +114,11 @@ int proc_nr_inodes(struct ctl_table *table, int write,
114} 114}
115#endif 115#endif
116 116
117static int no_open(struct inode *inode, struct file *file)
118{
119 return -ENXIO;
120}
121
117/** 122/**
118 * inode_init_always - perform inode structure intialisation 123 * inode_init_always - perform inode structure intialisation
119 * @sb: superblock inode belongs to 124 * @sb: superblock inode belongs to
@@ -125,7 +130,7 @@ int proc_nr_inodes(struct ctl_table *table, int write,
125int inode_init_always(struct super_block *sb, struct inode *inode) 130int inode_init_always(struct super_block *sb, struct inode *inode)
126{ 131{
127 static const struct inode_operations empty_iops; 132 static const struct inode_operations empty_iops;
128 static const struct file_operations empty_fops; 133 static const struct file_operations no_open_fops = {.open = no_open};
129 struct address_space *const mapping = &inode->i_data; 134 struct address_space *const mapping = &inode->i_data;
130 135
131 inode->i_sb = sb; 136 inode->i_sb = sb;
@@ -133,7 +138,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
133 inode->i_flags = 0; 138 inode->i_flags = 0;
134 atomic_set(&inode->i_count, 1); 139 atomic_set(&inode->i_count, 1);
135 inode->i_op = &empty_iops; 140 inode->i_op = &empty_iops;
136 inode->i_fop = &empty_fops; 141 inode->i_fop = &no_open_fops;
137 inode->__i_nlink = 1; 142 inode->__i_nlink = 1;
138 inode->i_opflags = 0; 143 inode->i_opflags = 0;
139 i_uid_write(inode, 0); 144 i_uid_write(inode, 0);
@@ -1798,7 +1803,7 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
1798 } else if (S_ISFIFO(mode)) 1803 } else if (S_ISFIFO(mode))
1799 inode->i_fop = &pipefifo_fops; 1804 inode->i_fop = &pipefifo_fops;
1800 else if (S_ISSOCK(mode)) 1805 else if (S_ISSOCK(mode))
1801 inode->i_fop = &bad_sock_fops; 1806 ; /* leave it no_open_fops */
1802 else 1807 else
1803 printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for" 1808 printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
1804 " inode %s:%lu\n", mode, inode->i_sb->s_id, 1809 " inode %s:%lu\n", mode, inode->i_sb->s_id,