summaryrefslogtreecommitdiffstats
path: root/src/fuse
diff options
context:
space:
mode:
authorSimon Rettberg2018-06-13 15:44:07 +0200
committerSimon Rettberg2018-06-13 15:44:07 +0200
commit2f93678ed8f7bd79c4d6de05dc5f3e3c24361c44 (patch)
tree8348125e340e8ecad50e450408a2fb8a93159d5a /src/fuse
parent[SERVER] Print info about signal sender (diff)
downloaddnbd3-2f93678ed8f7bd79c4d6de05dc5f3e3c24361c44.tar.gz
dnbd3-2f93678ed8f7bd79c4d6de05dc5f3e3c24361c44.tar.xz
dnbd3-2f93678ed8f7bd79c4d6de05dc5f3e3c24361c44.zip
[FUSE] Move variables into block where they're being used
Diffstat (limited to 'src/fuse')
-rw-r--r--src/fuse/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fuse/main.c b/src/fuse/main.c
index adf7b23..b064a9b 100644
--- a/src/fuse/main.c
+++ b/src/fuse/main.c
@@ -165,11 +165,11 @@ static int image_read(const char *path, char *buf, size_t size, off_t offset, st
size = imageSize - offset;
}
- /* count the requested blocks */
- uint64_t startBlock = offset / ( 4096 );
- const uint64_t endBlock = ( offset + size - 1 ) / ( 4096 );
-
if ( useDebug ) {
+ /* count the requested blocks */
+ uint64_t startBlock = offset / ( 4096 );
+ const uint64_t endBlock = ( offset + size - 1 ) / ( 4096 );
+
for ( ; startBlock <= endBlock; startBlock++ ) {
++logInfo.blockRequestCount[startBlock];
}