The term "length" is ambiguous, use "blk_len" instead to be clear.
Signed-off-by: Hanna Czenczek <[email protected]> --- block/export/fuse.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index f6a5f4fa0a..d45c6b814f 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -637,7 +637,7 @@ static void fuse_read(fuse_req_t req, fuse_ino_t inode, size_t size, off_t offset, struct fuse_file_info *fi) { FuseExport *exp = fuse_req_userdata(req); - int64_t length; + int64_t blk_len; void *buf; int ret; @@ -651,14 +651,14 @@ static void fuse_read(fuse_req_t req, fuse_ino_t inode, * Clients will expect short reads at EOF, so we have to limit * offset+size to the image length. */ - length = blk_getlength(exp->common.blk); - if (length < 0) { - fuse_reply_err(req, -length); + blk_len = blk_getlength(exp->common.blk); + if (blk_len < 0) { + fuse_reply_err(req, -blk_len); return; } - if (offset + size > length) { - size = length - offset; + if (offset + size > blk_len) { + size = blk_len - offset; } buf = qemu_try_blockalign(blk_bs(exp->common.blk), size); @@ -685,7 +685,7 @@ static void fuse_write(fuse_req_t req, fuse_ino_t inode, const char *buf, { FuseExport *exp = fuse_req_userdata(req); QEMU_AUTO_VFREE void *copied = NULL; - int64_t length; + int64_t blk_len; int ret; /* Limited by max_write, should not happen */ @@ -711,13 +711,13 @@ static void fuse_write(fuse_req_t req, fuse_ino_t inode, const char *buf, * Clients will expect short writes at EOF, so we have to limit * offset+size to the image length. */ - length = blk_getlength(exp->common.blk); - if (length < 0) { - fuse_reply_err(req, -length); + blk_len = blk_getlength(exp->common.blk); + if (blk_len < 0) { + fuse_reply_err(req, -blk_len); return; } - if (offset + size > length) { + if (offset + size > blk_len) { if (exp->growable) { ret = fuse_do_truncate(exp, offset + size, true, PREALLOC_MODE_OFF); if (ret < 0) { @@ -725,7 +725,7 @@ static void fuse_write(fuse_req_t req, fuse_ino_t inode, const char *buf, return; } } else { - size = length - offset; + size = blk_len - offset; } } -- 2.53.0
