Support fallocate(2) modes on FUSE
I39f7f69bb615977b8a8e7c84368ed043cdaf7665 added fallocate(2) support
for FUSE conservatively. It was implemented with posix_fallocate(3)
which only supports the default '0' mode in fallocate(2)
Now, we support other modes
Bug: 184920848
Test: Manual
Change-Id: I5965c607a3225fd3b23dc7a41229494d3914c3db
diff --git a/jni/FuseDaemon.cpp b/jni/FuseDaemon.cpp
index a482e01..833e9c6 100755
--- a/jni/FuseDaemon.cpp
+++ b/jni/FuseDaemon.cpp
@@ -749,13 +749,8 @@
ATRACE_CALL();
struct fuse* fuse = get_fuse(req);
- if (mode) {
- fuse_reply_err(req, EOPNOTSUPP);
- return;
- }
-
handle* h = reinterpret_cast<handle*>(fi->fh);
- auto err = posix_fallocate(h->fd, offset, length);
+ auto err = fallocate(h->fd, mode, offset, length);
fuse_reply_err(req, err);
}