summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 17:49:50 +1100
committerNick Piggin <npiggin@kernel.dk>2011-01-07 17:50:26 +1100
commitff0c7d15f9787b7e8c601533c015295cc68329f8 (patch)
treee3db53950b8ed78e542ab35a3cd3a6eaee26eccd /fs
parentfa0d7e3de6d6fc5004ad9dea0dd6b286af8f03e9 (diff)
downloadlinux-3.10-ff0c7d15f9787b7e8c601533c015295cc68329f8.tar.gz
linux-3.10-ff0c7d15f9787b7e8c601533c015295cc68329f8.tar.bz2
linux-3.10-ff0c7d15f9787b7e8c601533c015295cc68329f8.zip
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.c6
-rw-r--r--fs/pipe.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 6751dfe8cc0..da85e56378f 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -257,6 +257,12 @@ static struct inode *alloc_inode(struct super_block *sb)
return inode;
}
+void free_inode_nonrcu(struct inode *inode)
+{
+ kmem_cache_free(inode_cachep, inode);
+}
+EXPORT_SYMBOL(free_inode_nonrcu);
+
void __destroy_inode(struct inode *inode)
{
BUG_ON(inode_has_buffers(inode));
diff --git a/fs/pipe.c b/fs/pipe.c
index 04629f36e39..ae3592dcc88 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1253,6 +1253,10 @@ out:
return ret;
}
+static const struct super_operations pipefs_ops = {
+ .destroy_inode = free_inode_nonrcu,
+};
+
/*
* pipefs should _never_ be mounted by userland - too much of security hassle,
* no real gain from having the whole whorehouse mounted. So we don't need
@@ -1262,7 +1266,7 @@ out:
static struct dentry *pipefs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
- return mount_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC);
+ return mount_pseudo(fs_type, "pipe:", &pipefs_ops, PIPEFS_MAGIC);
}
static struct file_system_type pipe_fs_type = {