Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312912
b: refs/heads/master
c: 2a027e7
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent cffb4f4 commit f1e62f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 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: 96b7e579addd3cdc806c1667bf5b6b126070827c
refs/heads/master: 2a027e7a1873812240cbdac0f55c4734ff0042a5
33 changes: 12 additions & 21 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,26 +752,6 @@ static int do_dentry_open(struct dentry *dentry, struct vfsmount *mnt,
return error;
}

static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
struct file *f,
int (*open)(struct inode *, struct file *),
const struct cred *cred)
{
int error;
error = do_dentry_open(dentry, mnt, f, open, cred);
if (!error) {
error = open_check_o_direct(f);
if (error) {
fput(f);
f = ERR_PTR(error);
}
} else {
put_filp(f);
f = ERR_PTR(error);
}
return f;
}

/**
* finish_open - finish opening a file
* @od: opaque open data
Expand Down Expand Up @@ -841,7 +821,18 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
}

f->f_flags = flags;
return __dentry_open(dentry, mnt, f, NULL, cred);
error = do_dentry_open(dentry, mnt, f, NULL, cred);
if (!error) {
error = open_check_o_direct(f);
if (error) {
fput(f);
f = ERR_PTR(error);
}
} else {
put_filp(f);
f = ERR_PTR(error);
}
return f;
}
EXPORT_SYMBOL(dentry_open);

Expand Down

0 comments on commit f1e62f2

Please sign in to comment.