Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359169
b: refs/heads/master
c: 3451538
h: refs/heads/master
i:
  359167: 417edc1
v: v3
  • Loading branch information
Al Viro committed Feb 26, 2013
1 parent c540034 commit afadf50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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: 3f3834c35466324e3a7d7bf3a950dbcd99645f38
refs/heads/master: 3451538a114d738a6528b1da58e19e7d8964c647
19 changes: 15 additions & 4 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2865,6 +2865,16 @@ EXPORT_SYMBOL_GPL(shmem_truncate_range);

/* common code */

static char *shmem_dname(struct dentry *dentry, char *buffer, int buflen)
{
return dynamic_dname(dentry, buffer, buflen, "/%s (deleted)",
dentry->d_name.name);
}

static struct dentry_operations anon_ops = {
.d_dname = shmem_dname
};

/**
* shmem_file_setup - get an unlinked file living in tmpfs
* @name: name for dentry (to be seen in /proc/<pid>/maps
Expand All @@ -2876,7 +2886,7 @@ struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags
struct file *res;
struct inode *inode;
struct path path;
struct dentry *root;
struct super_block *sb;
struct qstr this;

if (IS_ERR(shm_mnt))
Expand All @@ -2892,14 +2902,15 @@ struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags
this.name = name;
this.len = strlen(name);
this.hash = 0; /* will go */
root = shm_mnt->mnt_root;
path.dentry = d_alloc(root, &this);
sb = shm_mnt->mnt_sb;
path.dentry = d_alloc_pseudo(sb, &this);
if (!path.dentry)
goto put_memory;
d_set_d_op(path.dentry, &anon_ops);
path.mnt = mntget(shm_mnt);

res = ERR_PTR(-ENOSPC);
inode = shmem_get_inode(root->d_sb, NULL, S_IFREG | S_IRWXUGO, 0, flags);
inode = shmem_get_inode(sb, NULL, S_IFREG | S_IRWXUGO, 0, flags);
if (!inode)
goto put_dentry;

Expand Down

0 comments on commit afadf50

Please sign in to comment.