Commit af58dc1f authored by Al Viro's avatar Al Viro

kernel_file_open(): get rid of inode argument

always equal to ->dentry->d_inode of the path argument these
days.
Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 613aee94
...@@ -563,8 +563,7 @@ static bool cachefiles_open_file(struct cachefiles_object *object, ...@@ -563,8 +563,7 @@ static bool cachefiles_open_file(struct cachefiles_object *object,
*/ */
path.mnt = cache->mnt; path.mnt = cache->mnt;
path.dentry = dentry; path.dentry = dentry;
file = kernel_file_open(&path, O_RDWR | O_LARGEFILE | O_DIRECT, file = kernel_file_open(&path, O_RDWR | O_LARGEFILE | O_DIRECT, cache->cache_cred);
d_backing_inode(dentry), cache->cache_cred);
if (IS_ERR(file)) { if (IS_ERR(file)) {
trace_cachefiles_vfs_error(object, d_backing_inode(dentry), trace_cachefiles_vfs_error(object, d_backing_inode(dentry),
PTR_ERR(file), PTR_ERR(file),
......
...@@ -1155,7 +1155,6 @@ EXPORT_SYMBOL(dentry_create); ...@@ -1155,7 +1155,6 @@ EXPORT_SYMBOL(dentry_create);
* kernel_file_open - open a file for kernel internal use * kernel_file_open - open a file for kernel internal use
* @path: path of the file to open * @path: path of the file to open
* @flags: open flags * @flags: open flags
* @inode: the inode
* @cred: credentials for open * @cred: credentials for open
* *
* Open a file for use by in-kernel consumers. The file is not accounted * Open a file for use by in-kernel consumers. The file is not accounted
...@@ -1165,7 +1164,7 @@ EXPORT_SYMBOL(dentry_create); ...@@ -1165,7 +1164,7 @@ EXPORT_SYMBOL(dentry_create);
* Return: Opened file on success, an error pointer on failure. * Return: Opened file on success, an error pointer on failure.
*/ */
struct file *kernel_file_open(const struct path *path, int flags, struct file *kernel_file_open(const struct path *path, int flags,
struct inode *inode, const struct cred *cred) const struct cred *cred)
{ {
struct file *f; struct file *f;
int error; int error;
...@@ -1175,7 +1174,7 @@ struct file *kernel_file_open(const struct path *path, int flags, ...@@ -1175,7 +1174,7 @@ struct file *kernel_file_open(const struct path *path, int flags,
return f; return f;
f->f_path = *path; f->f_path = *path;
error = do_dentry_open(f, inode, NULL); error = do_dentry_open(f, d_inode(path->dentry), NULL);
if (error) { if (error) {
fput(f); fput(f);
f = ERR_PTR(error); f = ERR_PTR(error);
......
...@@ -1376,7 +1376,7 @@ int ovl_ensure_verity_loaded(struct path *datapath) ...@@ -1376,7 +1376,7 @@ int ovl_ensure_verity_loaded(struct path *datapath)
* If this inode was not yet opened, the verity info hasn't been * If this inode was not yet opened, the verity info hasn't been
* loaded yet, so we need to do that here to force it into memory. * loaded yet, so we need to do that here to force it into memory.
*/ */
filp = kernel_file_open(datapath, O_RDONLY, inode, current_cred()); filp = kernel_file_open(datapath, O_RDONLY, current_cred());
if (IS_ERR(filp)) if (IS_ERR(filp))
return PTR_ERR(filp); return PTR_ERR(filp);
fput(filp); fput(filp);
......
...@@ -1906,7 +1906,7 @@ struct file *kernel_tmpfile_open(struct mnt_idmap *idmap, ...@@ -1906,7 +1906,7 @@ struct file *kernel_tmpfile_open(struct mnt_idmap *idmap,
umode_t mode, int open_flag, umode_t mode, int open_flag,
const struct cred *cred); const struct cred *cred);
struct file *kernel_file_open(const struct path *path, int flags, struct file *kernel_file_open(const struct path *path, int flags,
struct inode *inode, const struct cred *cred); const struct cred *cred);
int vfs_mkobj(struct dentry *, umode_t, int vfs_mkobj(struct dentry *, umode_t,
int (*f)(struct dentry *, umode_t, void *), int (*f)(struct dentry *, umode_t, void *),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment