]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fuse: move struct fuse_req and related to fuse_dev_i.h
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 19 Mar 2026 10:57:10 +0000 (11:57 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 15 Jun 2026 12:06:16 +0000 (14:06 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/fuse_dev_i.h
fs/fuse/fuse_i.h

index b512e484d3070d7feecc981ee6af67ed991100d9..9a9e14f9c8a476d72209fdd5450a80c735d2f565 100644 (file)
@@ -17,10 +17,95 @@ extern struct wait_queue_head fuse_dev_waitq;
 struct fuse_arg;
 struct fuse_args;
 struct fuse_pqueue;
-struct fuse_req;
 struct fuse_iqueue;
 struct fuse_forget_link;
 
+/**
+ * Request flags
+ *
+ * FR_ISREPLY:         set if the request has reply
+ * FR_FORCE:           force sending of the request even if interrupted
+ * FR_BACKGROUND:      request is sent in the background
+ * FR_WAITING:         request is counted as "waiting"
+ * FR_ABORTED:         the request was aborted
+ * FR_INTERRUPTED:     the request has been interrupted
+ * FR_LOCKED:          data is being copied to/from the request
+ * FR_PENDING:         request is not yet in userspace
+ * FR_SENT:            request is in userspace, waiting for an answer
+ * FR_FINISHED:                request is finished
+ * FR_PRIVATE:         request is on private list
+ * FR_ASYNC:           request is asynchronous
+ * FR_URING:           request is handled through fuse-io-uring
+ */
+enum fuse_req_flag {
+       FR_ISREPLY,
+       FR_FORCE,
+       FR_BACKGROUND,
+       FR_WAITING,
+       FR_ABORTED,
+       FR_INTERRUPTED,
+       FR_LOCKED,
+       FR_PENDING,
+       FR_SENT,
+       FR_FINISHED,
+       FR_PRIVATE,
+       FR_ASYNC,
+       FR_URING,
+};
+
+/**
+ * A request to the client
+ *
+ * .waitq.lock protects the following fields:
+ *   - FR_ABORTED
+ *   - FR_LOCKED (may also be modified under fpq->lock, tested under both)
+ */
+struct fuse_req {
+       /** This can be on either pending processing or io lists in
+           fuse_conn */
+       struct list_head list;
+
+       /** Entry on the interrupts list  */
+       struct list_head intr_entry;
+
+       /* Input/output arguments */
+       struct fuse_args *args;
+
+       /** refcount */
+       refcount_t count;
+
+       /* Request flags, updated with test/set/clear_bit() */
+       unsigned long flags;
+
+       /* The request input header */
+       struct {
+               struct fuse_in_header h;
+       } in;
+
+       /* The request output header */
+       struct {
+               struct fuse_out_header h;
+       } out;
+
+       /** Used to wake up the task waiting for completion of request*/
+       wait_queue_head_t waitq;
+
+#if IS_ENABLED(CONFIG_VIRTIO_FS)
+       /** virtio-fs's physically contiguous buffer for in and out args */
+       void *argbuf;
+#endif
+
+       /** fuse_mount this request belongs to */
+       struct fuse_mount *fm;
+
+#ifdef CONFIG_FUSE_IO_URING
+       void *ring_entry;
+       void *ring_queue;
+#endif
+       /** When (in jiffies) the request was created */
+       unsigned long create_time;
+};
+
 /**
  * Input queue callbacks
  *
@@ -290,6 +375,10 @@ struct fuse_dev *fuse_dev_alloc(void);
  */
 void fuse_pqueue_init(struct fuse_pqueue *fpq);
 
+/**
+ * End a finished request
+ */
+void fuse_request_end(struct fuse_req *req);
 
 #endif
 
index 7bc6c2054d1a58826d80cccee2b79cd491543ca7..e6c1c161214c86db56de65dc77badf58eb0cc42a 100644 (file)
@@ -383,92 +383,6 @@ struct fuse_io_priv {
        .iocb = i,                      \
 }
 
-/**
- * Request flags
- *
- * FR_ISREPLY:         set if the request has reply
- * FR_FORCE:           force sending of the request even if interrupted
- * FR_BACKGROUND:      request is sent in the background
- * FR_WAITING:         request is counted as "waiting"
- * FR_ABORTED:         the request was aborted
- * FR_INTERRUPTED:     the request has been interrupted
- * FR_LOCKED:          data is being copied to/from the request
- * FR_PENDING:         request is not yet in userspace
- * FR_SENT:            request is in userspace, waiting for an answer
- * FR_FINISHED:                request is finished
- * FR_PRIVATE:         request is on private list
- * FR_ASYNC:           request is asynchronous
- * FR_URING:           request is handled through fuse-io-uring
- */
-enum fuse_req_flag {
-       FR_ISREPLY,
-       FR_FORCE,
-       FR_BACKGROUND,
-       FR_WAITING,
-       FR_ABORTED,
-       FR_INTERRUPTED,
-       FR_LOCKED,
-       FR_PENDING,
-       FR_SENT,
-       FR_FINISHED,
-       FR_PRIVATE,
-       FR_ASYNC,
-       FR_URING,
-};
-
-/**
- * A request to the client
- *
- * .waitq.lock protects the following fields:
- *   - FR_ABORTED
- *   - FR_LOCKED (may also be modified under fpq->lock, tested under both)
- */
-struct fuse_req {
-       /** This can be on either pending processing or io lists in
-           fuse_conn */
-       struct list_head list;
-
-       /** Entry on the interrupts list  */
-       struct list_head intr_entry;
-
-       /* Input/output arguments */
-       struct fuse_args *args;
-
-       /** refcount */
-       refcount_t count;
-
-       /* Request flags, updated with test/set/clear_bit() */
-       unsigned long flags;
-
-       /* The request input header */
-       struct {
-               struct fuse_in_header h;
-       } in;
-
-       /* The request output header */
-       struct {
-               struct fuse_out_header h;
-       } out;
-
-       /** Used to wake up the task waiting for completion of request*/
-       wait_queue_head_t waitq;
-
-#if IS_ENABLED(CONFIG_VIRTIO_FS)
-       /** virtio-fs's physically contiguous buffer for in and out args */
-       void *argbuf;
-#endif
-
-       /** fuse_mount this request belongs to */
-       struct fuse_mount *fm;
-
-#ifdef CONFIG_FUSE_IO_URING
-       void *ring_entry;
-       void *ring_queue;
-#endif
-       /** When (in jiffies) the request was created */
-       unsigned long create_time;
-};
-
 enum fuse_dax_mode {
        FUSE_DAX_INODE_DEFAULT, /* default */
        FUSE_DAX_ALWAYS,        /* "-o dax=always" */
@@ -1094,11 +1008,6 @@ static inline ssize_t fuse_simple_idmap_request(struct mnt_idmap *idmap,
 int fuse_simple_background(struct fuse_mount *fm, struct fuse_args *args,
                           gfp_t gfp_flags);
 
-/**
- * End a finished request
- */
-void fuse_request_end(struct fuse_req *req);
-
 /* Abort all requests */
 void fuse_abort_conn(struct fuse_conn *fc);
 void fuse_wait_aborted(struct fuse_conn *fc);