Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226739
b: refs/heads/master
c: 4b93688
h: refs/heads/master
i:
  226737: 3548927
  226735: 8bb7421
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent d91487a commit 3489538
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 873feea09ebc980cbd3631b767356ce1eee65ec1
refs/heads/master: 4b936885ab04dc6e0bb0ef35e0e23c1a7364d9e5
2 changes: 1 addition & 1 deletion trunk/fs/anon_inodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ 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_pseudo(anon_inode_mnt->mnt_sb, &this);
if (!path.dentry)
goto err_module;

Expand Down
12 changes: 12 additions & 0 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,18 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
}
EXPORT_SYMBOL(d_alloc);

struct dentry *d_alloc_pseudo(struct super_block *sb, const struct qstr *name)
{
struct dentry *dentry = d_alloc(NULL, name);
if (dentry) {
dentry->d_sb = sb;
dentry->d_parent = dentry;
dentry->d_flags |= DCACHE_DISCONNECTED;
}
return dentry;
}
EXPORT_SYMBOL(d_alloc_pseudo);

struct dentry *d_alloc_name(struct dentry *parent, const char *name)
{
struct qstr q;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ 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_pseudo(pipe_mnt->mnt_sb, &name);
if (!path.dentry)
goto err_inode;
path.mnt = mntget(pipe_mnt);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op

/* allocate/de-allocate */
extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
extern struct dentry * d_obtain_alias(struct inode *);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ 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_pseudo(sock_mnt->mnt_sb, &name);
if (unlikely(!path.dentry)) {
put_unused_fd(fd);
return -ENOMEM;
Expand Down

0 comments on commit 3489538

Please sign in to comment.