summaryrefslogtreecommitdiffstats
path: root/src/server/image.h
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-15 22:03:36 +0100
committerSimon Rettberg2018-03-15 22:03:36 +0100
commit09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82 (patch)
treea2e936ba7e199badad7b18efa71576203bf5b48b /src/server/image.h
parent[SERVER] Make TSAN happy (diff)
downloaddnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.tar.gz
dnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.tar.xz
dnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.zip
[SERVER] Experimental support for sparse files in proxy mode
Will not preallocate images in this mode. Old images are only deleted if the disk is full, determined by write() calls to the cache file yielding ENOSPC or EDQUOT. In such a case, the least recently used image(s) will be deleted to free up at least 256MiB, and then the write() call will be repeated. This *should* work somewhat reliably unless the cache partition is ridiculously small. Performance might suffer a little, and disk fragmentation might occur much faster than in prealloc mode. Testing is needed.
Diffstat (limited to 'src/server/image.h')
-rw-r--r--src/server/image.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/image.h b/src/server/image.h
index 213734d..2290744 100644
--- a/src/server/image.h
+++ b/src/server/image.h
@@ -43,6 +43,8 @@ int image_getCompletenessEstimate(dnbd3_image_t * const image);
void image_closeUnusedFd();
+bool image_ensureDiskSpaceLocked(uint64_t size, bool force);
+
// one byte in the map covers 8 4kib blocks, so 32kib per byte
// "+ (1 << 15) - 1" is required to account for the last bit of
// the image that is smaller than 32kib