mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 22:28:00 +00:00
fold __dentry_open() into its sole caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
96b7e579ad
commit
2a027e7a18
1 changed files with 12 additions and 21 deletions
33
fs/open.c
33
fs/open.c
|
@ -752,26 +752,6 @@ cleanup_file:
|
||||||
return error;
|
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
|
* finish_open - finish opening a file
|
||||||
* @od: opaque open data
|
* @od: opaque open data
|
||||||
|
@ -841,7 +821,18 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
f->f_flags = 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);
|
EXPORT_SYMBOL(dentry_open);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue