[Virtio-fs] [PATCH 2/4] virtiofsd: Use macros for write_flag parsing
Dr. David Alan Gilbert
dgilbert at redhat.com
Wed Aug 14 09:13:29 UTC 2019
* Vivek Goyal (vgoyal at redhat.com) wrote:
> Use macros instead of hard coded bit positions.
>
> Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
OK, this is part of upstream 1b7d2b8
Reviewed-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
> ---
> contrib/virtiofsd/fuse_lowlevel.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/virtiofsd/fuse_lowlevel.c b/contrib/virtiofsd/fuse_lowlevel.c
> index 8d3f141d23..417f99e8dc 100644
> --- a/contrib/virtiofsd/fuse_lowlevel.c
> +++ b/contrib/virtiofsd/fuse_lowlevel.c
> @@ -1161,7 +1161,7 @@ static void do_write(fuse_req_t req, fuse_ino_t nodeid,
>
> memset(&fi, 0, sizeof(fi));
> fi.fh = arg->fh;
> - fi.writepage = (arg->write_flags & 1) != 0;
> + fi.writepage = (arg->write_flags & FUSE_WRITE_CACHE) != 0;
>
> if (!compat) {
> fi.lock_owner = arg->lock_owner;
> @@ -1208,7 +1208,7 @@ static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid,
> }
>
> fi.fh = arg->fh;
> - fi.writepage = arg->write_flags & 1;
> + fi.writepage = !!(arg->write_flags & FUSE_WRITE_CACHE);
>
> if (ibufv->count == 1) {
> assert(!(tmpbufv.buf[0].flags & FUSE_BUF_IS_FD));
> --
> 2.17.2
>
--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK
More information about the Virtio-fs
mailing list