From: Vivek Goyal Date: Tue, 13 Aug 2019 15:29:42 -0400 Message-Id: <20190813192944.26009-3-vgoyal@redhat.com> In-Reply-To: <20190813192944.26009-1-vgoyal@redhat.com> References: <20190813192944.26009-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Virtio-fs] [PATCH 2/4] virtiofsd: Use macros for write_flag parsing List-Id: Development discussions about virtio-fs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: virtio-fs@redhat.com Use macros instead of hard coded bit positions. Signed-off-by: Vivek Goyal --- 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