Skip to content

Commit d0f9c62

Browse files
bsberndMiklos Szeredi
authored andcommitted
fuse: Make fuse_copy non static
Move 'struct fuse_copy_state' and fuse_copy_* functions to fuse_dev_i.h to make it available for fuse-io-uring. 'copy_out_args()' is renamed to 'fuse_copy_out_args'. 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 24fe962 commit d0f9c62

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

fs/fuse/dev.c

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -678,22 +678,8 @@ static int unlock_request(struct fuse_req *req)
678678
return err;
679679
}
680680

681-
struct fuse_copy_state {
682-
int write;
683-
struct fuse_req *req;
684-
struct iov_iter *iter;
685-
struct pipe_buffer *pipebufs;
686-
struct pipe_buffer *currbuf;
687-
struct pipe_inode_info *pipe;
688-
unsigned long nr_segs;
689-
struct page *pg;
690-
unsigned len;
691-
unsigned offset;
692-
unsigned move_pages:1;
693-
};
694-
695-
static void fuse_copy_init(struct fuse_copy_state *cs, int write,
696-
struct iov_iter *iter)
681+
void fuse_copy_init(struct fuse_copy_state *cs, int write,
682+
struct iov_iter *iter)
697683
{
698684
memset(cs, 0, sizeof(*cs));
699685
cs->write = write;
@@ -1054,9 +1040,9 @@ static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size)
10541040
}
10551041

10561042
/* Copy request arguments to/from userspace buffer */
1057-
static int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs,
1058-
unsigned argpages, struct fuse_arg *args,
1059-
int zeroing)
1043+
int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs,
1044+
unsigned argpages, struct fuse_arg *args,
1045+
int zeroing)
10601046
{
10611047
int err = 0;
10621048
unsigned i;
@@ -1933,8 +1919,8 @@ static struct fuse_req *request_find(struct fuse_pqueue *fpq, u64 unique)
19331919
return NULL;
19341920
}
19351921

1936-
static int copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args,
1937-
unsigned nbytes)
1922+
int fuse_copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args,
1923+
unsigned nbytes)
19381924
{
19391925
unsigned reqsize = sizeof(struct fuse_out_header);
19401926

@@ -2036,7 +2022,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
20362022
if (oh.error)
20372023
err = nbytes != sizeof(oh) ? -EINVAL : 0;
20382024
else
2039-
err = copy_out_args(cs, req->args, nbytes);
2025+
err = fuse_copy_out_args(cs, req->args, nbytes);
20402026
fuse_copy_finish(cs);
20412027

20422028
spin_lock(&fpq->lock);

fs/fuse/fuse_dev_i.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212
#define FUSE_INT_REQ_BIT (1ULL << 0)
1313
#define FUSE_REQ_ID_STEP (1ULL << 1)
1414

15+
struct fuse_arg;
16+
struct fuse_args;
17+
18+
struct fuse_copy_state {
19+
int write;
20+
struct fuse_req *req;
21+
struct iov_iter *iter;
22+
struct pipe_buffer *pipebufs;
23+
struct pipe_buffer *currbuf;
24+
struct pipe_inode_info *pipe;
25+
unsigned long nr_segs;
26+
struct page *pg;
27+
unsigned int len;
28+
unsigned int offset;
29+
unsigned int move_pages:1;
30+
};
31+
1532
static inline struct fuse_dev *fuse_get_dev(struct file *file)
1633
{
1734
/*
@@ -23,5 +40,13 @@ static inline struct fuse_dev *fuse_get_dev(struct file *file)
2340

2441
void fuse_dev_end_requests(struct list_head *head);
2542

43+
void fuse_copy_init(struct fuse_copy_state *cs, int write,
44+
struct iov_iter *iter);
45+
int fuse_copy_args(struct fuse_copy_state *cs, unsigned int numargs,
46+
unsigned int argpages, struct fuse_arg *args,
47+
int zeroing);
48+
int fuse_copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args,
49+
unsigned int nbytes);
50+
2651
#endif
2752

0 commit comments

Comments
 (0)