diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:50 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:26 -0500 |
commit | ff0c7d15f9787b7e8c601533c015295cc68329f8 (patch) | |
tree | e3db53950b8ed78e542ab35a3cd3a6eaee26eccd /fs | |
parent | fa0d7e3de6d6fc5004ad9dea0dd6b286af8f03e9 (diff) |
fs: avoid inode RCU freeing for pseudo fs
Pseudo filesystems that don't put inode on RCU list or reachable by
rcu-walk dentries do not need to RCU free their inodes.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/inode.c | 6 | ||||
-rw-r--r-- | fs/pipe.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index 6751dfe8cc06..da85e56378f3 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -257,6 +257,12 @@ static struct inode *alloc_inode(struct super_block *sb) | |||
257 | return inode; | 257 | return inode; |
258 | } | 258 | } |
259 | 259 | ||
260 | void free_inode_nonrcu(struct inode *inode) | ||
261 | { | ||
262 | kmem_cache_free(inode_cachep, inode); | ||
263 | } | ||
264 | EXPORT_SYMBOL(free_inode_nonrcu); | ||
265 | |||
260 | void __destroy_inode(struct inode *inode) | 266 | void __destroy_inode(struct inode *inode) |
261 | { | 267 | { |
262 | BUG_ON(inode_has_buffers(inode)); | 268 | BUG_ON(inode_has_buffers(inode)); |
@@ -1253,6 +1253,10 @@ out: | |||
1253 | return ret; | 1253 | return ret; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static const struct super_operations pipefs_ops = { | ||
1257 | .destroy_inode = free_inode_nonrcu, | ||
1258 | }; | ||
1259 | |||
1256 | /* | 1260 | /* |
1257 | * pipefs should _never_ be mounted by userland - too much of security hassle, | 1261 | * pipefs should _never_ be mounted by userland - too much of security hassle, |
1258 | * no real gain from having the whole whorehouse mounted. So we don't need | 1262 | * no real gain from having the whole whorehouse mounted. So we don't need |
@@ -1262,7 +1266,7 @@ out: | |||
1262 | static struct dentry *pipefs_mount(struct file_system_type *fs_type, | 1266 | static struct dentry *pipefs_mount(struct file_system_type *fs_type, |
1263 | int flags, const char *dev_name, void *data) | 1267 | int flags, const char *dev_name, void *data) |
1264 | { | 1268 | { |
1265 | return mount_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC); | 1269 | return mount_pseudo(fs_type, "pipe:", &pipefs_ops, PIPEFS_MAGIC); |
1266 | } | 1270 | } |
1267 | 1271 | ||
1268 | static struct file_system_type pipe_fs_type = { | 1272 | static struct file_system_type pipe_fs_type = { |