Skip to content

Commit f773a7c

Browse files
bsberndMiklos Szeredi
authored andcommitted
fuse: Add fuse-io-uring handling into fuse_copy
Add special fuse-io-uring into the fuse argument copy handler. Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Joanne Koong <[email protected]> Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent d0f9c62 commit f773a7c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

fs/fuse/dev.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,9 @@ static int fuse_copy_do(struct fuse_copy_state *cs, void **val, unsigned *size)
786786
*size -= ncpy;
787787
cs->len -= ncpy;
788788
cs->offset += ncpy;
789+
if (cs->is_uring)
790+
cs->ring.copied_sz += ncpy;
791+
789792
return ncpy;
790793
}
791794

@@ -1922,7 +1925,14 @@ static struct fuse_req *request_find(struct fuse_pqueue *fpq, u64 unique)
19221925
int fuse_copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args,
19231926
unsigned nbytes)
19241927
{
1925-
unsigned reqsize = sizeof(struct fuse_out_header);
1928+
1929+
unsigned int reqsize = 0;
1930+
1931+
/*
1932+
* Uring has all headers separated from args - args is payload only
1933+
*/
1934+
if (!cs->is_uring)
1935+
reqsize = sizeof(struct fuse_out_header);
19261936

19271937
reqsize += fuse_len_args(args->out_numargs, args->out_args);
19281938

fs/fuse/fuse_dev_i.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ struct fuse_copy_state {
2727
unsigned int len;
2828
unsigned int offset;
2929
unsigned int move_pages:1;
30+
unsigned int is_uring:1;
31+
struct {
32+
unsigned int copied_sz; /* copied size into the user buffer */
33+
} ring;
3034
};
3135

3236
static inline struct fuse_dev *fuse_get_dev(struct file *file)

0 commit comments

Comments
 (0)