Re: [Virtio-fs] [PATCH] virtiofsd: Remove unused enum fuse_buf_copy_flags
* Xiao Yang (yangx...@cn.fujitsu.com) wrote: > On 2020/1/23 2:52, Dr. David Alan Gilbert wrote: > > I'm confused as to which version this patch is against; all the worlds I > > can see don't take 'req' into fuse_buf_copy. > Hi Dave, > > I just used the development branch: > https://gitlab.com/virtio-fs/qemu/tree/virtio-fs-dev > > I saw that fuse_buf_copy() still has 'req' parameter on this branch. Is it > obsolete? > https://gitlab.com/virtio-fs/qemu/blob/virtio-fs-dev/tools/virtiofsd/buffer.c#L270 OK, my mistake - the 'req' parameter is added late on, in the DAX extensions; so I need to backport this cleanup before it. I'll do that. Dave > Best Regards, > Xiao Yang > > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
Re: [Virtio-fs] [PATCH] virtiofsd: Remove unused enum fuse_buf_copy_flags
On 2020/1/23 2:52, Dr. David Alan Gilbert wrote: I'm confused as to which version this patch is against; all the worlds I can see don't take 'req' into fuse_buf_copy. Hi Dave, I just used the development branch: https://gitlab.com/virtio-fs/qemu/tree/virtio-fs-dev I saw that fuse_buf_copy() still has 'req' parameter on this branch. Is it obsolete? https://gitlab.com/virtio-fs/qemu/blob/virtio-fs-dev/tools/virtiofsd/buffer.c#L270 Best Regards, Xiao Yang ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
Re: [Virtio-fs] [PATCH] virtiofsd: Remove unused enum fuse_buf_copy_flags
* Xiao Yang (yangx...@cn.fujitsu.com) wrote: > Signed-off-by: Xiao Yang > --- > tools/virtiofsd/buffer.c | 7 +++-- > tools/virtiofsd/fuse_common.h| 46 +--- > tools/virtiofsd/fuse_lowlevel.c | 13 - > tools/virtiofsd/fuse_lowlevel.h | 35 ++-- > tools/virtiofsd/passthrough_ll.c | 4 +-- > 5 files changed, 13 insertions(+), 92 deletions(-) > > diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c > index 2b3d4d8653..3aefba13d5 100644 > --- a/tools/virtiofsd/buffer.c > +++ b/tools/virtiofsd/buffer.c > @@ -207,7 +207,7 @@ static ssize_t fuse_buf_fd_to_fd(const struct fuse_buf > *dst, size_t dst_off, > static ssize_t fuse_buf_copy_one(fuse_req_t req, > const struct fuse_buf *dst, size_t dst_off, > const struct fuse_buf *src, size_t src_off, > - size_t len, enum fuse_buf_copy_flags flags) > + size_t len) > { > int src_is_fd = src->flags & FUSE_BUF_IS_FD; > int dst_is_fd = dst->flags & FUSE_BUF_IS_FD; > @@ -267,7 +267,7 @@ static int fuse_bufvec_advance(struct fuse_bufvec *bufv, > size_t len) > } > > ssize_t fuse_buf_copy(fuse_req_t req, struct fuse_bufvec *dstv, > - struct fuse_bufvec *srcv, enum fuse_buf_copy_flags > flags) > + struct fuse_bufvec *srcv) I'm confused as to which version this patch is against; all the worlds I can see don't take 'req' into fuse_buf_copy. Dave > { > size_t copied = 0, i; > > @@ -309,8 +309,7 @@ ssize_t fuse_buf_copy(fuse_req_t req, struct fuse_bufvec > *dstv, > dst_len = dst->size - dstv->off; > len = min_size(src_len, dst_len); > > -res = fuse_buf_copy_one(req, dst, dstv->off, src, srcv->off, len, > -flags); > +res = fuse_buf_copy_one(req, dst, dstv->off, src, srcv->off, len); > if (res < 0) { > if (!copied) { > return res; > diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h > index c8e3026735..aa7e6ed31a 100644 > --- a/tools/virtiofsd/fuse_common.h > +++ b/tools/virtiofsd/fuse_common.h > @@ -617,48 +617,6 @@ enum fuse_buf_flags { > FUSE_BUF_PHYS_ADDR = (1 << 4), > }; > > -/** > - * Buffer copy flags > - */ > -enum fuse_buf_copy_flags { > -/** > - * Don't use splice(2) > - * > - * Always fall back to using read and write instead of > - * splice(2) to copy data from one file descriptor to another. > - * > - * If this flag is not set, then only fall back if splice is > - * unavailable. > - */ > -FUSE_BUF_NO_SPLICE = (1 << 1), > - > -/** > - * Force splice > - * > - * Always use splice(2) to copy data from one file descriptor > - * to another. If splice is not available, return -EINVAL. > - */ > -FUSE_BUF_FORCE_SPLICE = (1 << 2), > - > -/** > - * Try to move data with splice. > - * > - * If splice is used, try to move pages from the source to the > - * destination instead of copying. See documentation of > - * SPLICE_F_MOVE in splice(2) man page. > - */ > -FUSE_BUF_SPLICE_MOVE = (1 << 3), > - > -/** > - * Don't block on the pipe when copying data with splice > - * > - * Makes the operations on the pipe non-blocking (if the pipe > - * is full or empty). See SPLICE_F_NONBLOCK in the splice(2) > - * man page. > - */ > -FUSE_BUF_SPLICE_NONBLOCK = (1 << 4), > -}; > - > /** > * Single data buffer > * > @@ -755,12 +713,10 @@ size_t fuse_buf_size(const struct fuse_bufvec *bufv); > * @param req The request this copy is part of > * @param dst destination buffer vector > * @param src source buffer vector > - * @param flags flags controlling the copy > * @return actual number of bytes copied or -errno on error > */ > ssize_t fuse_buf_copy(fuse_req_t req, > - struct fuse_bufvec *dst, struct fuse_bufvec *src, > - enum fuse_buf_copy_flags flags); > + struct fuse_bufvec *dst, struct fuse_bufvec *src); > > /** > * Memory buffer iterator > diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c > index 3543cf293c..bba0001a2c 100644 > --- a/tools/virtiofsd/fuse_lowlevel.c > +++ b/tools/virtiofsd/fuse_lowlevel.c > @@ -511,16 +511,14 @@ static int fuse_send_data_iov_fallback(struct > fuse_session *se, > > static int fuse_send_data_iov(struct fuse_session *se, struct fuse_chan *ch, >struct iovec *iov, int iov_count, > - struct fuse_bufvec *buf, unsigned int flags) > + struct fuse_bufvec *buf) > { > size_t len = fuse_buf_size(buf); > -(void)flags; > > return fuse_send_data_iov_fallback(se, ch, iov, iov_count, buf, len); > } > >
Re: [Virtio-fs] [PATCH] virtiofsd: Remove unused enum fuse_buf_copy_flags
On Wed, Jan 22, 2020 at 10:40:08AM +0800, Xiao Yang wrote: > Signed-off-by: Xiao Yang > --- > tools/virtiofsd/buffer.c | 7 +++-- > tools/virtiofsd/fuse_common.h| 46 +--- > tools/virtiofsd/fuse_lowlevel.c | 13 - > tools/virtiofsd/fuse_lowlevel.h | 35 ++-- > tools/virtiofsd/passthrough_ll.c | 4 +-- > 5 files changed, 13 insertions(+), 92 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
[Virtio-fs] [PATCH] virtiofsd: Remove unused enum fuse_buf_copy_flags
Signed-off-by: Xiao Yang --- tools/virtiofsd/buffer.c | 7 +++-- tools/virtiofsd/fuse_common.h| 46 +--- tools/virtiofsd/fuse_lowlevel.c | 13 - tools/virtiofsd/fuse_lowlevel.h | 35 ++-- tools/virtiofsd/passthrough_ll.c | 4 +-- 5 files changed, 13 insertions(+), 92 deletions(-) diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c index 2b3d4d8653..3aefba13d5 100644 --- a/tools/virtiofsd/buffer.c +++ b/tools/virtiofsd/buffer.c @@ -207,7 +207,7 @@ static ssize_t fuse_buf_fd_to_fd(const struct fuse_buf *dst, size_t dst_off, static ssize_t fuse_buf_copy_one(fuse_req_t req, const struct fuse_buf *dst, size_t dst_off, const struct fuse_buf *src, size_t src_off, - size_t len, enum fuse_buf_copy_flags flags) + size_t len) { int src_is_fd = src->flags & FUSE_BUF_IS_FD; int dst_is_fd = dst->flags & FUSE_BUF_IS_FD; @@ -267,7 +267,7 @@ static int fuse_bufvec_advance(struct fuse_bufvec *bufv, size_t len) } ssize_t fuse_buf_copy(fuse_req_t req, struct fuse_bufvec *dstv, - struct fuse_bufvec *srcv, enum fuse_buf_copy_flags flags) + struct fuse_bufvec *srcv) { size_t copied = 0, i; @@ -309,8 +309,7 @@ ssize_t fuse_buf_copy(fuse_req_t req, struct fuse_bufvec *dstv, dst_len = dst->size - dstv->off; len = min_size(src_len, dst_len); -res = fuse_buf_copy_one(req, dst, dstv->off, src, srcv->off, len, -flags); +res = fuse_buf_copy_one(req, dst, dstv->off, src, srcv->off, len); if (res < 0) { if (!copied) { return res; diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h index c8e3026735..aa7e6ed31a 100644 --- a/tools/virtiofsd/fuse_common.h +++ b/tools/virtiofsd/fuse_common.h @@ -617,48 +617,6 @@ enum fuse_buf_flags { FUSE_BUF_PHYS_ADDR = (1 << 4), }; -/** - * Buffer copy flags - */ -enum fuse_buf_copy_flags { -/** - * Don't use splice(2) - * - * Always fall back to using read and write instead of - * splice(2) to copy data from one file descriptor to another. - * - * If this flag is not set, then only fall back if splice is - * unavailable. - */ -FUSE_BUF_NO_SPLICE = (1 << 1), - -/** - * Force splice - * - * Always use splice(2) to copy data from one file descriptor - * to another. If splice is not available, return -EINVAL. - */ -FUSE_BUF_FORCE_SPLICE = (1 << 2), - -/** - * Try to move data with splice. - * - * If splice is used, try to move pages from the source to the - * destination instead of copying. See documentation of - * SPLICE_F_MOVE in splice(2) man page. - */ -FUSE_BUF_SPLICE_MOVE = (1 << 3), - -/** - * Don't block on the pipe when copying data with splice - * - * Makes the operations on the pipe non-blocking (if the pipe - * is full or empty). See SPLICE_F_NONBLOCK in the splice(2) - * man page. - */ -FUSE_BUF_SPLICE_NONBLOCK = (1 << 4), -}; - /** * Single data buffer * @@ -755,12 +713,10 @@ size_t fuse_buf_size(const struct fuse_bufvec *bufv); * @param req The request this copy is part of * @param dst destination buffer vector * @param src source buffer vector - * @param flags flags controlling the copy * @return actual number of bytes copied or -errno on error */ ssize_t fuse_buf_copy(fuse_req_t req, - struct fuse_bufvec *dst, struct fuse_bufvec *src, - enum fuse_buf_copy_flags flags); + struct fuse_bufvec *dst, struct fuse_bufvec *src); /** * Memory buffer iterator diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c index 3543cf293c..bba0001a2c 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -511,16 +511,14 @@ static int fuse_send_data_iov_fallback(struct fuse_session *se, static int fuse_send_data_iov(struct fuse_session *se, struct fuse_chan *ch, struct iovec *iov, int iov_count, - struct fuse_bufvec *buf, unsigned int flags) + struct fuse_bufvec *buf) { size_t len = fuse_buf_size(buf); -(void)flags; return fuse_send_data_iov_fallback(se, ch, iov, iov_count, buf, len); } -int fuse_reply_data(fuse_req_t req, struct fuse_bufvec *bufv, -enum fuse_buf_copy_flags flags) +int fuse_reply_data(fuse_req_t req, struct fuse_bufvec *bufv) { struct iovec iov[2]; struct fuse_out_header out = { @@ -531,7 +529,7 @@ int fuse_reply_data(fuse_req_t req, struct fuse_bufvec *bufv, iov[0].iov_base = iov[0].iov_len = sizeof(struct fuse_out_header); -res =