]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fuse: remove #include "fuse_i.h" from dev.c and dev_uring.c
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 1 Apr 2026 07:02:14 +0000 (09:02 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 15 Jun 2026 12:06:18 +0000 (14:06 +0200)
Move a couple of function declarations from fuse_i.h to dev.h and
fuse_dev_i.h.

Add fuse_conn_get_id() helper that retrieves the connection ID (s_dev) from
fuse_conn.

With the exception of cuse.c, virtio_fs.c and trace.c source files now
either include fuse_i.h or fuse_dev_i/dev_uring_i.h but not both.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/backing.c
fs/fuse/dev.c
fs/fuse/dev.h
fs/fuse/dev_uring.c
fs/fuse/fuse_dev_i.h
fs/fuse/fuse_i.h
fs/fuse/inode.c

index d95dfa48483f0aed1c9ae5dc4a026f23700fa9df..3d3f49c2dd4229fcb8d297cbddc6d01ab68940a0 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (c) 2023 CTERA Networks.
  */
 
+#include "dev.h"
 #include "fuse_i.h"
 
 #include <linux/file.h>
index aab98f75b9dd39ca677c93ff32a6b0c9bb4746ad..2403cd445e720643c9d11dac5b077a038db152e0 100644 (file)
@@ -7,9 +7,8 @@
 */
 
 #include "dev.h"
+#include "args.h"
 #include "dev_uring_i.h"
-#include "fuse_i.h"
-#include "fuse_dev_i.h"
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -2349,7 +2348,7 @@ static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)
        if (!fud)
                return;
 
-       seq_printf(seq, "fuse_connection:\t%u\n", fud->chan->conn->dev);
+       seq_printf(seq, "fuse_connection:\t%u\n", fuse_conn_get_id(fud->chan->conn));
 }
 #endif
 
index 6437331058d93767a8878c9ad6e189c1d57831e9..aed69fd14c41dff28a7cae9330280e8201880fc6 100644 (file)
@@ -13,6 +13,7 @@ struct fuse_chan;
 struct fuse_dev;
 struct fuse_args;
 struct fuse_copy_state;
+struct fuse_backing_map;
 struct file;
 struct folio;
 enum fuse_notify_code;
@@ -45,6 +46,16 @@ void fuse_chan_queue_forget(struct fuse_chan *fch, struct fuse_forget_link *forg
 
 DEFINE_FREE(fuse_chan_free, struct fuse_chan *, if (_T) fuse_chan_free(_T))
 
+/**
+ * Initialize the client device
+ */
+int fuse_dev_init(void);
+
+/**
+ * Cleanup the client device
+ */
+void fuse_dev_cleanup(void);
+
 void fuse_dev_install(struct fuse_dev *fud, struct fuse_chan *fch);
 bool fuse_dev_verify(struct fuse_dev *fud, struct fuse_chan *fch);
 void fuse_dev_put(struct fuse_dev *fud);
@@ -58,10 +69,25 @@ void fuse_init_server_timeout(struct fuse_chan *fch, unsigned int timeout);
 void fuse_chan_abort(struct fuse_chan *fch, bool abort_with_err);
 void fuse_chan_wait_aborted(struct fuse_chan *fch);
 
+/**
+ * Acquire reference to fuse_conn
+ */
+struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
+
+/**
+ * Release reference to fuse_conn
+ */
+void fuse_conn_put(struct fuse_conn *fc);
+
+dev_t fuse_conn_get_id(struct fuse_conn *fc);
+
 void fuse_end_polls(struct fuse_conn *fc);
 int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
                unsigned int size, struct fuse_copy_state *cs);
 
+int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map);
+int fuse_backing_close(struct fuse_conn *fc, int backing_id);
+
 int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size);
 int fuse_copy_folio(struct fuse_copy_state *cs, struct folio **foliop,
                    unsigned offset, unsigned count, int zeroing);
index f3603f1f7040bc7c66d7bfe29436104f6bb0614e..99138e3ec83fee256596849e4455b04b0a302994 100644 (file)
@@ -5,9 +5,8 @@
  */
 
 #include "dev.h"
-#include "fuse_i.h"
+#include "args.h"
 #include "dev_uring_i.h"
-#include "fuse_dev_i.h"
 #include "fuse_trace.h"
 
 #include <linux/fs.h>
index 6550952f815bf4b49ce4acfbaee4f862fe9a977d..dcfafac786fc56788f40b4ce7a32448dcf9d2b5d 100644 (file)
@@ -364,6 +364,11 @@ void fuse_request_bg_finish(struct fuse_chan *fch, struct fuse_req *req);
 
 void fuse_copy_init(struct fuse_copy_state *cs, bool write,
                           struct iov_iter *iter);
+/**
+ * Return the number of bytes in an arguments list
+ */
+unsigned int fuse_len_args(unsigned int numargs, struct fuse_arg *args);
+
 int fuse_copy_args(struct fuse_copy_state *cs, unsigned int numargs,
                   unsigned int argpages, struct fuse_arg *args,
                   int zeroing);
@@ -389,6 +394,8 @@ u64 fuse_get_unique(struct fuse_iqueue *fiq);
 struct fuse_dev *fuse_dev_alloc_install(struct fuse_chan *fch);
 struct fuse_dev *fuse_dev_alloc(void);
 
+int fuse_dev_release(struct inode *inode, struct file *file);
+
 /**
  * Initialize the fuse processing queue
  */
index f7a9c7cedd39623afc158e5a31a5cee0c6fc0c18..8c58a030d296ed2de978a2425213605360271b2c 100644 (file)
@@ -907,16 +907,6 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
 
 u32 fuse_get_cache_mask(struct inode *inode);
 
-/**
- * Initialize the client device
- */
-int fuse_dev_init(void);
-
-/**
- * Cleanup the client device
- */
-void fuse_dev_cleanup(void);
-
 int fuse_ctl_init(void);
 void __exit fuse_ctl_cleanup(void);
 
@@ -971,22 +961,12 @@ u64 fuse_time_to_jiffies(u64 sec, u32 nsec);
 
 void fuse_change_entry_timeout(struct dentry *entry, struct fuse_entry_out *o);
 
-/**
- * Acquire reference to fuse_conn
- */
-struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
-
 /**
  * Initialize fuse_conn
  */
 void fuse_conn_init(struct fuse_conn *fc, struct fuse_mount *fm,
                    struct user_namespace *user_ns, struct fuse_chan *fch);
 
-/**
- * Release reference to fuse_conn
- */
-void fuse_conn_put(struct fuse_conn *fc);
-
 int fuse_send_init(struct fuse_mount *fm);
 
 /**
@@ -1105,7 +1085,6 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
 long fuse_ioctl_common(struct file *file, unsigned int cmd,
                       unsigned long arg, unsigned int flags);
 __poll_t fuse_file_poll(struct file *file, poll_table *wait);
-int fuse_dev_release(struct inode *inode, struct file *file);
 
 bool fuse_write_update_attr(struct inode *inode, loff_t pos, ssize_t written);
 
@@ -1136,11 +1115,6 @@ int fuse_set_acl(struct mnt_idmap *, struct dentry *dentry,
 /* readdir.c */
 int fuse_readdir(struct file *file, struct dir_context *ctx);
 
-/**
- * Return the number of bytes in an arguments list
- */
-unsigned int fuse_len_args(unsigned int numargs, struct fuse_arg *args);
-
 void fuse_free_conn(struct fuse_conn *fc);
 
 /* dax.c */
@@ -1208,8 +1182,6 @@ static inline struct fuse_backing *fuse_backing_lookup(struct fuse_conn *fc,
 
 void fuse_backing_files_init(struct fuse_conn *fc);
 void fuse_backing_files_free(struct fuse_conn *fc);
-int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map);
-int fuse_backing_close(struct fuse_conn *fc, int backing_id);
 
 /* passthrough.c */
 static inline struct fuse_backing *fuse_inode_backing(struct fuse_inode *fi)
index 79047734ab4064809ca6d3dffaee09eda6cbe037..438d5211222c4eceda31f0e26ce4c16efa5941ed 100644 (file)
@@ -1031,6 +1031,11 @@ struct fuse_conn *fuse_conn_get(struct fuse_conn *fc)
 }
 EXPORT_SYMBOL_GPL(fuse_conn_get);
 
+dev_t fuse_conn_get_id(struct fuse_conn *fc)
+{
+       return fc->dev;
+}
+
 static struct inode *fuse_get_root_inode(struct super_block *sb, unsigned int mode)
 {
        struct fuse_attr attr;