From: Tomohiro Kusumi <tkusumi@xxxxxxxxxx> Use the same naming scheme as in arg. There's also struct fuse_args as temporary holder of in/out args before in/out args get copied to a fuse request, which makes these structures a bit confusing. Signed-off-by: Tomohiro Kusumi <tkusumi@xxxxxxxxxx> --- fs/fuse/dev.c | 17 ++++++++++------- fs/fuse/fuse_i.h | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index f117926..3bb180c 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -288,7 +288,10 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req) } EXPORT_SYMBOL_GPL(fuse_put_request); -static unsigned len_args(unsigned numargs, struct fuse_arg *args) +/* + * This function also works for fuse_in_arg + */ +static unsigned len_args(unsigned numargs, struct fuse_out_arg *args) { unsigned nbytes = 0; unsigned i; @@ -307,7 +310,7 @@ static u64 fuse_get_unique(struct fuse_iqueue *fiq) static void queue_request(struct fuse_iqueue *fiq, struct fuse_req *req) { req->in.h.len = sizeof(struct fuse_in_header) + - len_args(req->in.numargs, (struct fuse_arg *) req->in.args); + len_args(req->in.numargs, (struct fuse_out_arg *) req->in.args); list_add_tail(&req->list, &fiq->pending); wake_up_locked(&fiq->waitq); kill_fasync(&fiq->fasync, SIGIO, POLL_IN); @@ -543,7 +546,7 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args) req->out.argvar = args->out.argvar; req->out.numargs = args->out.numargs; memcpy(req->out.args, args->out.args, - args->out.numargs * sizeof(struct fuse_arg)); + args->out.numargs * sizeof(struct fuse_out_arg)); fuse_request_send(fc, req); ret = req->out.h.error; if (!ret && args->out.argvar) { @@ -1021,14 +1024,14 @@ static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size) /* Copy request arguments to/from userspace buffer */ static int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs, - unsigned argpages, struct fuse_arg *args, + unsigned argpages, struct fuse_out_arg *args, int zeroing) { int err = 0; unsigned i; for (i = 0; !err && i < numargs; i++) { - struct fuse_arg *arg = &args[i]; + struct fuse_out_arg *arg = &args[i]; if (i == numargs - 1 && argpages) err = fuse_copy_pages(cs, arg->size, zeroing); else @@ -1275,7 +1278,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, err = fuse_copy_one(cs, &in->h, sizeof(in->h)); if (!err) err = fuse_copy_args(cs, in->numargs, in->argpages, - (struct fuse_arg *) in->args, 0); + (struct fuse_out_arg *) in->args, 0); fuse_copy_finish(cs); spin_lock(&fpq->lock); clear_bit(FR_LOCKED, &req->flags); @@ -1794,7 +1797,7 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out, if (reqsize < nbytes || (reqsize > nbytes && !out->argvar)) return -EINVAL; else if (reqsize > nbytes) { - struct fuse_arg *lastarg = &out->args[out->numargs-1]; + struct fuse_out_arg *lastarg = &out->args[out->numargs-1]; unsigned diffsize = reqsize - nbytes; if (diffsize > lastarg->size) return -EINVAL; diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 9130794..5022fbe 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -177,7 +177,7 @@ struct fuse_in { }; /** One output argument of a request */ -struct fuse_arg { +struct fuse_out_arg { unsigned size; void *value; }; @@ -209,7 +209,7 @@ struct fuse_out { unsigned numargs; /** Array of arguments */ - struct fuse_arg args[2]; + struct fuse_out_arg args[2]; }; /** FUSE page descriptor */ @@ -231,7 +231,7 @@ struct fuse_args { struct { unsigned argvar:1; unsigned numargs; - struct fuse_arg args[2]; + struct fuse_out_arg args[2]; } out; }; -- 2.9.3