|
@@ -736,8 +736,7 @@ int open_check_o_direct(struct file *f)
|
|
|
|
|
|
static int do_dentry_open(struct file *f,
|
|
static int do_dentry_open(struct file *f,
|
|
struct inode *inode,
|
|
struct inode *inode,
|
|
- int (*open)(struct inode *, struct file *),
|
|
|
|
- const struct cred *cred)
|
|
|
|
|
|
+ int (*open)(struct inode *, struct file *))
|
|
{
|
|
{
|
|
static const struct file_operations empty_fops = {};
|
|
static const struct file_operations empty_fops = {};
|
|
int error;
|
|
int error;
|
|
@@ -777,7 +776,7 @@ static int do_dentry_open(struct file *f,
|
|
goto cleanup_all;
|
|
goto cleanup_all;
|
|
}
|
|
}
|
|
|
|
|
|
- error = security_file_open(f, cred);
|
|
|
|
|
|
+ error = security_file_open(f, f->f_cred);
|
|
if (error)
|
|
if (error)
|
|
goto cleanup_all;
|
|
goto cleanup_all;
|
|
|
|
|
|
@@ -855,8 +854,7 @@ int finish_open(struct file *file, struct dentry *dentry,
|
|
BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
|
|
BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
|
|
|
|
|
|
file->f_path.dentry = dentry;
|
|
file->f_path.dentry = dentry;
|
|
- error = do_dentry_open(file, d_backing_inode(dentry), open,
|
|
|
|
- current_cred());
|
|
|
|
|
|
+ error = do_dentry_open(file, d_backing_inode(dentry), open);
|
|
if (!error)
|
|
if (!error)
|
|
*opened |= FILE_OPENED;
|
|
*opened |= FILE_OPENED;
|
|
|
|
|
|
@@ -897,8 +895,7 @@ EXPORT_SYMBOL(file_path);
|
|
* @file: newly allocated file with f_flag initialized
|
|
* @file: newly allocated file with f_flag initialized
|
|
* @cred: credentials to use
|
|
* @cred: credentials to use
|
|
*/
|
|
*/
|
|
-int vfs_open(const struct path *path, struct file *file,
|
|
|
|
- const struct cred *cred)
|
|
|
|
|
|
+int vfs_open(const struct path *path, struct file *file)
|
|
{
|
|
{
|
|
struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags, 0);
|
|
struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags, 0);
|
|
|
|
|
|
@@ -906,7 +903,7 @@ int vfs_open(const struct path *path, struct file *file,
|
|
return PTR_ERR(dentry);
|
|
return PTR_ERR(dentry);
|
|
|
|
|
|
file->f_path = *path;
|
|
file->f_path = *path;
|
|
- return do_dentry_open(file, d_backing_inode(dentry), NULL, cred);
|
|
|
|
|
|
+ return do_dentry_open(file, d_backing_inode(dentry), NULL);
|
|
}
|
|
}
|
|
|
|
|
|
struct file *dentry_open(const struct path *path, int flags,
|
|
struct file *dentry_open(const struct path *path, int flags,
|
|
@@ -922,7 +919,7 @@ struct file *dentry_open(const struct path *path, int flags,
|
|
|
|
|
|
f = alloc_empty_file(flags, cred);
|
|
f = alloc_empty_file(flags, cred);
|
|
if (!IS_ERR(f)) {
|
|
if (!IS_ERR(f)) {
|
|
- error = vfs_open(path, f, cred);
|
|
|
|
|
|
+ error = vfs_open(path, f);
|
|
if (!error) {
|
|
if (!error) {
|
|
/* from now on we need fput() to dispose of f */
|
|
/* from now on we need fput() to dispose of f */
|
|
error = open_check_o_direct(f);
|
|
error = open_check_o_direct(f);
|