summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 15:38:32 -0800
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 17:32:51 +0200
commit2be75efa508e89528c173ea0eae71a29de040124 (patch)
tree3e6c553ce0e002b2b68ac631bfa697e211a07324
parent7e835af8566b68c0396256cdcb371f62e9cdb5fa (diff)
downloadlwn-2be75efa508e89528c173ea0eae71a29de040124.tar.gz
lwn-2be75efa508e89528c173ea0eae71a29de040124.zip
fs-scale-pseudo
Regardless of how much we possibly try to scale dcache, there is likely always going to be some fundamental contention when adding or removing children under the same parent. Pseudo filesystems do not seem need to have connected dentries because by definition they are disconnected. XXX: is this right? I can't see any reason why they need to have a real parent. TODO: add a d_instantiate_something() and avoid adding the extra checks for !d_parent Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--fs/anon_inodes.c4
-rw-r--r--fs/pipe.c4
-rw-r--r--net/socket.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 81f82e7e7290..c714d50eea79 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -105,9 +105,11 @@ struct file *anon_inode_getfile(const char *name,
this.name = name;
this.len = strlen(name);
this.hash = 0;
- path.dentry = d_alloc(anon_inode_mnt->mnt_sb->s_root, &this);
+ path.dentry = d_alloc(NULL, &this);
if (!path.dentry)
goto err_module;
+ path.dentry->d_parent = path.dentry;
+ path.dentry->d_flags |= DCACHE_DISCONNECTED;
path.mnt = mntget(anon_inode_mnt);
/*
diff --git a/fs/pipe.c b/fs/pipe.c
index a9dcf21a8871..4ef0fb045b6f 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -983,10 +983,12 @@ struct file *create_write_pipe(int flags)
goto err;
err = -ENOMEM;
- path.dentry = d_alloc(pipe_mnt->mnt_sb->s_root, &name);
+ path.dentry = d_alloc(NULL, &name);
if (!path.dentry)
goto err_inode;
path.mnt = mntget(pipe_mnt);
+ path.dentry->d_parent = path.dentry;
+ path.dentry->d_flags |= DCACHE_DISCONNECTED;
path.dentry->d_op = &pipefs_dentry_operations;
d_instantiate(path.dentry, inode);
diff --git a/net/socket.c b/net/socket.c
index 371eaf092a31..ac4463b2bd40 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -360,12 +360,14 @@ static int sock_alloc_file(struct socket *sock, struct file **f, int flags)
if (unlikely(fd < 0))
return fd;
- path.dentry = d_alloc(sock_mnt->mnt_sb->s_root, &name);
+ path.dentry = d_alloc(NULL, &name);
if (unlikely(!path.dentry)) {
put_unused_fd(fd);
return -ENOMEM;
}
path.mnt = mntget(sock_mnt);
+ path.dentry->d_parent = path.dentry;
+ path.dentry->d_flags |= DCACHE_DISCONNECTED;
path.dentry->d_op = &sockfs_dentry_operations;
d_instantiate(path.dentry, SOCK_INODE(sock));