Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit af58dc1

Browse files
author
Al Viro
committed
kernel_file_open(): get rid of inode argument
always equal to ->dentry->d_inode of the path argument these days. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 613aee9 commit af58dc1

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

fs/cachefiles/namei.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,7 @@ static bool cachefiles_open_file(struct cachefiles_object *object,
563563
*/
564564
path.mnt = cache->mnt;
565565
path.dentry = dentry;
566-
file = kernel_file_open(&path, O_RDWR | O_LARGEFILE | O_DIRECT,
567-
d_backing_inode(dentry), cache->cache_cred);
566+
file = kernel_file_open(&path, O_RDWR | O_LARGEFILE | O_DIRECT, cache->cache_cred);
568567
if (IS_ERR(file)) {
569568
trace_cachefiles_vfs_error(object, d_backing_inode(dentry),
570569
PTR_ERR(file),

fs/open.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ EXPORT_SYMBOL(dentry_create);
11551155
* kernel_file_open - open a file for kernel internal use
11561156
* @path: path of the file to open
11571157
* @flags: open flags
1158-
* @inode: the inode
11591158
* @cred: credentials for open
11601159
*
11611160
* Open a file for use by in-kernel consumers. The file is not accounted
@@ -1165,7 +1164,7 @@ EXPORT_SYMBOL(dentry_create);
11651164
* Return: Opened file on success, an error pointer on failure.
11661165
*/
11671166
struct file *kernel_file_open(const struct path *path, int flags,
1168-
struct inode *inode, const struct cred *cred)
1167+
const struct cred *cred)
11691168
{
11701169
struct file *f;
11711170
int error;
@@ -1175,7 +1174,7 @@ struct file *kernel_file_open(const struct path *path, int flags,
11751174
return f;
11761175

11771176
f->f_path = *path;
1178-
error = do_dentry_open(f, inode, NULL);
1177+
error = do_dentry_open(f, d_inode(path->dentry), NULL);
11791178
if (error) {
11801179
fput(f);
11811180
f = ERR_PTR(error);

fs/overlayfs/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ int ovl_ensure_verity_loaded(struct path *datapath)
13761376
* If this inode was not yet opened, the verity info hasn't been
13771377
* loaded yet, so we need to do that here to force it into memory.
13781378
*/
1379-
filp = kernel_file_open(datapath, O_RDONLY, inode, current_cred());
1379+
filp = kernel_file_open(datapath, O_RDONLY, current_cred());
13801380
if (IS_ERR(filp))
13811381
return PTR_ERR(filp);
13821382
fput(filp);

include/linux/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ struct file *kernel_tmpfile_open(struct mnt_idmap *idmap,
19061906
umode_t mode, int open_flag,
19071907
const struct cred *cred);
19081908
struct file *kernel_file_open(const struct path *path, int flags,
1909-
struct inode *inode, const struct cred *cred);
1909+
const struct cred *cred);
19101910

19111911
int vfs_mkobj(struct dentry *, umode_t,
19121912
int (*f)(struct dentry *, umode_t, void *),

0 commit comments

Comments
 (0)