summaryrefslogtreecommitdiff
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2024-02-02 13:30:30 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2024-02-23 17:36:32 +0100
commit7de64d521bf92396b7da8ae0600188ea5d75a4c9 (patch)
treef25623e90fac50d741de1d5076e2345aa7dad2b9 /fs/fuse/file.c
parente26ee4efbc79610b20e7abe9d96c87f33dacc1ff (diff)
fuse: break up fuse_open_common()
fuse_open_common() has a lot of code relevant only for regular files and O_TRUNC in particular. Copy the little bit of remaining code into fuse_dir_open() and stop using this common helper for directory open. Also split out fuse_dir_finish_open() from fuse_finish_open() before we add inode io modes to fuse_finish_open(). Suggested-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index bdda420f5acf..c7f21b439d2b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -227,7 +227,7 @@ static void fuse_truncate_update_attr(struct inode *inode, struct file *file)
fuse_invalidate_attr_mask(inode, FUSE_STATX_MODSIZE);
}
-int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
+static int fuse_open(struct inode *inode, struct file *file)
{
struct fuse_mount *fm = get_fuse_mount(inode);
struct fuse_conn *fc = fm->fc;
@@ -256,7 +256,7 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
if (is_wb_truncate || dax_truncate)
fuse_set_nowrite(inode);
- err = fuse_do_open(fm, get_node_id(inode), file, isdir);
+ err = fuse_do_open(fm, get_node_id(inode), file, false);
if (!err) {
fuse_finish_open(inode, file);
if (is_truncate)
@@ -354,11 +354,6 @@ void fuse_release_common(struct file *file, bool isdir)
(fl_owner_t) file, isdir);
}
-static int fuse_open(struct inode *inode, struct file *file)
-{
- return fuse_open_common(inode, file, false);
-}
-
static int fuse_release(struct inode *inode, struct file *file)
{
struct fuse_conn *fc = get_fuse_conn(inode);