Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359168
b: refs/heads/master
c: 3f3834c
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Feb 23, 2013
1 parent 417edc1 commit c540034
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 2248b87ec1d9f59001d8c69513b2892ac04a2a3d
refs/heads/master: 3f3834c35466324e3a7d7bf3a950dbcd99645f38
16 changes: 13 additions & 3 deletions trunk/drivers/oprofile/oprofilefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,22 @@ static int __oprofilefs_create_file(struct super_block *sb,
struct dentry *dentry;
struct inode *inode;

mutex_lock(&root->d_inode->i_mutex);
dentry = d_alloc_name(root, name);
if (!dentry)
if (!dentry) {
mutex_unlock(&root->d_inode->i_mutex);
return -ENOMEM;
}
inode = oprofilefs_get_inode(sb, S_IFREG | perm);
if (!inode) {
dput(dentry);
mutex_unlock(&root->d_inode->i_mutex);
return -ENOMEM;
}
inode->i_fop = fops;
inode->i_private = priv;
d_add(dentry, inode);
dentry->d_inode->i_private = priv;
mutex_unlock(&root->d_inode->i_mutex);
return 0;
}

Expand Down Expand Up @@ -212,17 +217,22 @@ struct dentry *oprofilefs_mkdir(struct super_block *sb,
struct dentry *dentry;
struct inode *inode;

mutex_lock(&root->d_inode->i_mutex);
dentry = d_alloc_name(root, name);
if (!dentry)
if (!dentry) {
mutex_unlock(&root->d_inode->i_mutex);
return NULL;
}
inode = oprofilefs_get_inode(sb, S_IFDIR | 0755);
if (!inode) {
dput(dentry);
mutex_unlock(&root->d_inode->i_mutex);
return NULL;
}
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
d_add(dentry, inode);
mutex_unlock(&root->d_inode->i_mutex);
return dentry;
}

Expand Down

0 comments on commit c540034

Please sign in to comment.