summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobb Glasser <rglasser@google.com>2016-09-26 21:15:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-09-26 21:15:24 +0000
commitbba43b374bfefa00f83ac444dbc0b4c35d1f69b1 (patch)
tree92ee5463332f66fe14c427a1017824a9b7fd2f6a
parent320a603b3272dfe93f1934dd647ce16d342daaa2 (diff)
parent738e0dcf0a09fa7659a7efa79de9482f7cf54e4f (diff)
downloadcore-bba43b374bfefa00f83ac444dbc0b4c35d1f69b1.tar.gz
Merge "[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available" into nyc-mr1-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 9480e4ab9..13ebaf157 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -1221,7 +1221,13 @@ static int handle_open(struct fuse* fuse, struct fuse_handler* handler,
}
out.fh = ptr_to_id(h);
out.open_flags = 0;
+
+#ifdef FUSE_SHORTCIRCUIT
+ out.lower_fd = h->fd;
+#else
out.padding = 0;
+#endif
+
fuse_reply(fuse, hdr->unique, &out, sizeof(out));
return NO_STATUS;
}
@@ -1385,7 +1391,13 @@ static int handle_opendir(struct fuse* fuse, struct fuse_handler* handler,
}
out.fh = ptr_to_id(h);
out.open_flags = 0;
+
+#ifdef FUSE_SHORTCIRCUIT
+ out.lower_fd = -1;
+#else
out.padding = 0;
+#endif
+
fuse_reply(fuse, hdr->unique, &out, sizeof(out));
return NO_STATUS;
}
@@ -1467,6 +1479,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_SHORTCIRCUIT
+ out.flags |= FUSE_SHORTCIRCUIT;
+#endif
+
out.max_background = 32;
out.congestion_threshold = 32;
out.max_write = MAX_WRITE;