Message ID | 20241209-fuse-uring-for-6-10-rfc4-v8-9-d9f9f2642be3@ddn.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | fuse: fuse-over-io-uring | expand |
On Mon, Dec 9, 2024 at 6:57 AM Bernd Schubert <bschubert@ddn.com> wrote: > > fuse-over-io-uring uses existing functions to find requests based > on their unique id - make these functions non-static. > > Signed-off-by: Bernd Schubert <bschubert@ddn.com> Reviewed-by: Joanne Koong <joannelkoong@gmail.com> > --- > fs/fuse/dev.c | 6 +++--- > fs/fuse/fuse_dev_i.h | 6 ++++++ > fs/fuse/fuse_i.h | 5 +++++ > fs/fuse/inode.c | 2 +- > 4 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c > index 2ba153054f7ba61a870c847cb87d81168220661f..a45d92431769d4aadaf5c5792086abc5dda3c048 100644 > --- a/fs/fuse/dev.c > +++ b/fs/fuse/dev.c > @@ -220,7 +220,7 @@ u64 fuse_get_unique(struct fuse_iqueue *fiq) > } > EXPORT_SYMBOL_GPL(fuse_get_unique); > > -static unsigned int fuse_req_hash(u64 unique) > +unsigned int fuse_req_hash(u64 unique) > { > return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); > } > @@ -1910,7 +1910,7 @@ static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code, > } > > /* Look up request on processing list by unique ID */ > -static struct fuse_req *request_find(struct fuse_pqueue *fpq, u64 unique) > +struct fuse_req *fuse_request_find(struct fuse_pqueue *fpq, u64 unique) > { > unsigned int hash = fuse_req_hash(unique); > struct fuse_req *req; > @@ -1994,7 +1994,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, > spin_lock(&fpq->lock); > req = NULL; > if (fpq->connected) > - req = request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT); > + req = fuse_request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT); > > err = -ENOENT; > if (!req) { > diff --git a/fs/fuse/fuse_dev_i.h b/fs/fuse/fuse_dev_i.h > index 0708730b656b97071de9a5331ef4d51a112c602c..d7bf72dabd84c3896d1447380649e2f4d20b0643 100644 > --- a/fs/fuse/fuse_dev_i.h > +++ b/fs/fuse/fuse_dev_i.h > @@ -7,6 +7,7 @@ > #define _FS_FUSE_DEV_I_H > > #include <linux/types.h> > +#include <linux/fs.h> Is this include needed? > > /* Ordinary requests have even IDs, while interrupts IDs are odd */ > #define FUSE_INT_REQ_BIT (1ULL << 0) > @@ -14,6 +15,8 @@ > > struct fuse_arg; > struct fuse_args; > +struct fuse_pqueue; > +struct fuse_req; > > struct fuse_copy_state { > int write; > @@ -43,6 +46,9 @@ static inline struct fuse_dev *fuse_get_dev(struct file *file) > return READ_ONCE(file->private_data); > } > > +unsigned int fuse_req_hash(u64 unique); > +struct fuse_req *fuse_request_find(struct fuse_pqueue *fpq, u64 unique); > + > void fuse_dev_end_requests(struct list_head *head); > > void fuse_copy_init(struct fuse_copy_state *cs, int write, > diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h > index d75dd9b59a5c35b76919db760645464f604517f5..e545b0864dd51e82df61cc39bdf65d3d36a418dc 100644 > --- a/fs/fuse/fuse_i.h > +++ b/fs/fuse/fuse_i.h > @@ -1237,6 +1237,11 @@ void fuse_change_entry_timeout(struct dentry *entry, struct fuse_entry_out *o); > */ > struct fuse_conn *fuse_conn_get(struct fuse_conn *fc); > > +/** > + * Initialize the fuse processing queue > + */ > +void fuse_pqueue_init(struct fuse_pqueue *fpq); > + > /** > * Initialize fuse_conn > */ > diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c > index e4f9bbacfc1bc6f51d5d01b4c47b42cc159ed783..328797b9aac9a816a4ad2c69b6880dc6ef6222b0 100644 > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -938,7 +938,7 @@ static void fuse_iqueue_init(struct fuse_iqueue *fiq, > fiq->priv = priv; > } > > -static void fuse_pqueue_init(struct fuse_pqueue *fpq) > +void fuse_pqueue_init(struct fuse_pqueue *fpq) > { > unsigned int i; > > > -- > 2.43.0 >
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2ba153054f7ba61a870c847cb87d81168220661f..a45d92431769d4aadaf5c5792086abc5dda3c048 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -220,7 +220,7 @@ u64 fuse_get_unique(struct fuse_iqueue *fiq) } EXPORT_SYMBOL_GPL(fuse_get_unique); -static unsigned int fuse_req_hash(u64 unique) +unsigned int fuse_req_hash(u64 unique) { return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); } @@ -1910,7 +1910,7 @@ static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code, } /* Look up request on processing list by unique ID */ -static struct fuse_req *request_find(struct fuse_pqueue *fpq, u64 unique) +struct fuse_req *fuse_request_find(struct fuse_pqueue *fpq, u64 unique) { unsigned int hash = fuse_req_hash(unique); struct fuse_req *req; @@ -1994,7 +1994,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, spin_lock(&fpq->lock); req = NULL; if (fpq->connected) - req = request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT); + req = fuse_request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT); err = -ENOENT; if (!req) { diff --git a/fs/fuse/fuse_dev_i.h b/fs/fuse/fuse_dev_i.h index 0708730b656b97071de9a5331ef4d51a112c602c..d7bf72dabd84c3896d1447380649e2f4d20b0643 100644 --- a/fs/fuse/fuse_dev_i.h +++ b/fs/fuse/fuse_dev_i.h @@ -7,6 +7,7 @@ #define _FS_FUSE_DEV_I_H #include <linux/types.h> +#include <linux/fs.h> /* Ordinary requests have even IDs, while interrupts IDs are odd */ #define FUSE_INT_REQ_BIT (1ULL << 0) @@ -14,6 +15,8 @@ struct fuse_arg; struct fuse_args; +struct fuse_pqueue; +struct fuse_req; struct fuse_copy_state { int write; @@ -43,6 +46,9 @@ static inline struct fuse_dev *fuse_get_dev(struct file *file) return READ_ONCE(file->private_data); } +unsigned int fuse_req_hash(u64 unique); +struct fuse_req *fuse_request_find(struct fuse_pqueue *fpq, u64 unique); + void fuse_dev_end_requests(struct list_head *head); void fuse_copy_init(struct fuse_copy_state *cs, int write, diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index d75dd9b59a5c35b76919db760645464f604517f5..e545b0864dd51e82df61cc39bdf65d3d36a418dc 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1237,6 +1237,11 @@ void fuse_change_entry_timeout(struct dentry *entry, struct fuse_entry_out *o); */ struct fuse_conn *fuse_conn_get(struct fuse_conn *fc); +/** + * Initialize the fuse processing queue + */ +void fuse_pqueue_init(struct fuse_pqueue *fpq); + /** * Initialize fuse_conn */ diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index e4f9bbacfc1bc6f51d5d01b4c47b42cc159ed783..328797b9aac9a816a4ad2c69b6880dc6ef6222b0 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -938,7 +938,7 @@ static void fuse_iqueue_init(struct fuse_iqueue *fiq, fiq->priv = priv; } -static void fuse_pqueue_init(struct fuse_pqueue *fpq) +void fuse_pqueue_init(struct fuse_pqueue *fpq) { unsigned int i;
fuse-over-io-uring uses existing functions to find requests based on their unique id - make these functions non-static. Signed-off-by: Bernd Schubert <bschubert@ddn.com> --- fs/fuse/dev.c | 6 +++--- fs/fuse/fuse_dev_i.h | 6 ++++++ fs/fuse/fuse_i.h | 5 +++++ fs/fuse/inode.c | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-)