diff options
author | Nikhilesh Reddy <reddyn@codeaurora.org> | 2015-05-18 15:49:39 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:22:38 -0600 |
commit | c3ebecfefb84f8328228c8253ead0eb6a9768ca8 (patch) | |
tree | 38d5c5f70050b18538fba260010e4564c82a69f8 /sdcard/sdcard.c | |
parent | 3421bd829aa7d878d5d85317e72cbc3aefedaccb (diff) | |
download | system_core-c3ebecfefb84f8328228c8253ead0eb6a9768ca8.zip system_core-c3ebecfefb84f8328228c8253ead0eb6a9768ca8.tar.gz system_core-c3ebecfefb84f8328228c8253ead0eb6a9768ca8.tar.bz2 |
sdcard : Use the fuse shortcircuit option
Use the fuse shortcircuit option for faster read and
write performance in the fuse mount points.
Change-Id: Iee11451348443108c82b14d6856e4c95a47159d1
Diffstat (limited to 'sdcard/sdcard.c')
-rw-r--r-- | sdcard/sdcard.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c index a79e2dd..840642b 100644 --- a/sdcard/sdcard.c +++ b/sdcard/sdcard.c @@ -1202,7 +1202,13 @@ static int handle_open(struct fuse* fuse, struct fuse_handler* handler, } out.fh = ptr_to_id(h); out.open_flags = 0; - out.padding = 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; } @@ -1366,7 +1372,13 @@ static int handle_opendir(struct fuse* fuse, struct fuse_handler* handler, } out.fh = ptr_to_id(h); out.open_flags = 0; - out.padding = 0; + + #ifdef FUSE_SHORTCIRCUIT + out.lower_fd = -1; + #else + out.padding = 0; + #endif + fuse_reply(fuse, hdr->unique, &out, sizeof(out)); return NO_STATUS; } @@ -1448,6 +1460,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; |