summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Strudel <tstrudel@google.com>2016-01-14 00:32:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-01-14 00:32:01 +0000
commitb84295d027c9d86720d93e19eb5c1b644553d647 (patch)
tree9b2c700382a78850fd52182f2cecfac4e9be57bb
parent905ad1d3e7531b49374573cd801fa92a480c97b8 (diff)
parentac5175f9a67d649f98dfbeef60026bf5dafa7da1 (diff)
downloadsystem_core-b84295d027c9d86720d93e19eb5c1b644553d647.zip
system_core-b84295d027c9d86720d93e19eb5c1b644553d647.tar.gz
system_core-b84295d027c9d86720d93e19eb5c1b644553d647.tar.bz2
Merge "[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available" into mnc-dr1.5-dev
-rw-r--r--sdcard/sdcard.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 06452aa..e9aa770 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -1214,7 +1214,13 @@ static int handle_open(struct fuse* fuse, struct fuse_handler* handler,
}
out.fh = ptr_to_id(h);
out.open_flags = 0;
+
+#ifdef FUSE_STACKED_IO
+ out.lower_fd = h->fd;
+#else
out.padding = 0;
+#endif
+
fuse_reply(fuse, hdr->unique, &out, sizeof(out));
return NO_STATUS;
}
@@ -1378,7 +1384,13 @@ static int handle_opendir(struct fuse* fuse, struct fuse_handler* handler,
}
out.fh = ptr_to_id(h);
out.open_flags = 0;
+
+#ifdef FUSE_STACKED_IO
+ out.lower_fd = -1;
+#else
out.padding = 0;
+#endif
+
fuse_reply(fuse, hdr->unique, &out, sizeof(out));
return NO_STATUS;
}
@@ -1460,6 +1472,11 @@ static int handle_init(struct fuse* fuse, struct fuse_handler* handler,
out.major = FUSE_KERNEL_VERSION;
out.max_readahead = req->max_readahead;
out.flags = FUSE_ATOMIC_O_TRUNC | FUSE_BIG_WRITES;
+
+#ifdef FUSE_STACKED_IO
+ out.flags |= FUSE_STACKED_IO;
+#endif
+
out.max_background = 32;
out.congestion_threshold = 32;
out.max_write = MAX_WRITE;