Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292363
b: refs/heads/master
c: 16d13b5
h: refs/heads/master
i:
  292361: 3d7958e
  292359: 56731e5
v: v3
  • Loading branch information
Al Viro committed Mar 21, 2012
1 parent 3db2d64 commit faf8a44
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 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: b7c177fcd2022ca8572284deb8f9b6ab5730eafb
refs/heads/master: 16d13b59b5b85ebc91de6c889716fa6e7766237f
55 changes: 27 additions & 28 deletions trunk/fs/configfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,36 +187,35 @@ static void configfs_set_inode_lock_class(struct configfs_dirent *sd,
int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct inode *))
{
int error = 0;
struct inode * inode = NULL;
if (dentry) {
if (!dentry->d_inode) {
struct configfs_dirent *sd = dentry->d_fsdata;
if ((inode = configfs_new_inode(mode, sd, dentry->d_sb))) {
if (dentry->d_parent && dentry->d_parent->d_inode) {
struct inode *p_inode = dentry->d_parent->d_inode;
p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
}
configfs_set_inode_lock_class(sd, inode);
goto Proceed;
}
else
error = -ENOMEM;
} else
error = -EEXIST;
} else
error = -ENOENT;
goto Done;
struct inode *inode = NULL;
struct configfs_dirent *sd;
struct inode *p_inode;

if (!dentry)
return -ENOENT;

if (dentry->d_inode)
return -EEXIST;

Proceed:
if (init)
sd = dentry->d_fsdata;
inode = configfs_new_inode(mode, sd, dentry->d_sb);
if (!inode)
return -ENOMEM;

p_inode = dentry->d_parent->d_inode;
p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
configfs_set_inode_lock_class(sd, inode);

if (init) {
error = init(inode);
if (!error) {
d_instantiate(dentry, inode);
if (S_ISDIR(mode) || S_ISLNK(mode))
dget(dentry); /* pin link and directory dentries in core */
} else
iput(inode);
Done:
if (error) {
iput(inode);
return error;
}
}
d_instantiate(dentry, inode);
if (S_ISDIR(mode) || S_ISLNK(mode))
dget(dentry); /* pin link and directory dentries in core */
return error;
}

Expand Down

0 comments on commit faf8a44

Please sign in to comment.