Re: [PATCH v10 09/17] fuse: {io-uring} Make hash-list req unique finding functions non-static

Bernd Schubert
2025-01-23T13:24:48Z

On 1/22/25 16:56, Luis Henriques wrote:
> On Mon, Jan 20 2025, Bernd Schubert wrote:
>
>> fuse-over-io-uring uses existing functions to find requests based
>> on their unique id - make these functions non-static.
>>
>
> Single comment below.
>
>> 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 8b03a540e151daa1f62986aa79030e9e7a456059..aa33eba51c51dff6af2cdcf60bed9c3f6b4bc0d0 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 4a8a4feb2df53fb84938a6711e6bcfd0f1b9f615..599a61536f8c85b3631b8584247a917bda92e719 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>
>
> Looking at these changes, it seems like this extra include isn't really
> necessary. Is it a leftover from older revs?

Hmm, right, I don't remember anymore why it ended up there. Not even
needed for later patches, so yeah, probably a left-over.

Thanks,
Bernd