Skip to content

Commit

Permalink
fold __dentry_open() into its sole caller
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent 96b7e57 commit 2a027e7
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions 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 2a027e7

Please sign in to comment.