summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Change the CHECK failure into function failure." into oc-devDaichi Hirono2017-05-171-1/+6
|\ | | | | | | | | | | am: bf6e949727 Change-Id: Ic374fc076cc9584c375618a57371669c23aff539
| * Merge "Change the CHECK failure into function failure." into oc-devTreeHugger Robot2017-05-161-1/+6
| |\
| | * Change the CHECK failure into function failure.Daichi Hirono2017-05-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we have CHECK in WriteInternal function to observe short writing. However it turns out short write can happen according to the bug report. To prevent app from crashing due to CHECK failure, the CL removes the CHECK and let WriteInternal return a failure value. Bug: 37561460 Test: libappfuse_tests, manually re-wrote the return value of write() and checked logcat. Change-Id: I6a1e233c3ddb8eb68f59e7c606ad0459b5ca2c6e
* | | Merge "Use SO_SNDBUFFORCE instead of SO_SNDBUF" into oc-devDaichi Hirono2017-05-171-2/+2
|\| | | | | | | | | | | | | | | | | am: 165dad791d Change-Id: I2da13af0ff1e4a50259847fd57695c3d616e59cc
| * | Use SO_SNDBUFFORCE instead of SO_SNDBUFDaichi Hirono2017-04-281-2/+2
| |/ | | | | | | | | | | | | | | | | | | When /proc/sys/net/core/wmem_max is smaller than kMaxMessageSize, we need to override the limitation. Bug: 37561460 Test: libappfuse_tests Change-Id: Ibaac8db61290d661459fdc46f0ae8416f7db1d9e
* | Merge "Add test config to libappfuse_test" am: dccf5a1dc8 am: 31d4b50cc4Dan Shi2017-04-042-0/+27
|\ \ | |/ |/| | | | | | | am: b44505e956 Change-Id: Iefe160951c3f638faee7e8e1f1ff63ed9133325c
| * Add test config to libappfuse_testDan Shi2017-03-312-0/+27
| | | | | | | | | | | | | | | | | | | | | | This change allows TradeFederation to run the test directly. Refer to b/35882476 for design and discussion of this change. Bug: 35882476 Test: local test tradefed.sh run template/local --template:map test=libappfuse_test Change-Id: Ic3a23d9d609036658fd37fc72571e2fc7db0e88d
* | Retry write operation when getting ENOBUFS.Daichi Hirono2017-03-301-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | Previously libappfuse set SO_SNDBUF to the maximum message size. However it does not prevent ENOBUF and it made AppFusePerfTest#testReadWriteFile flaky. The CL let FuseBuffer retry write operation when getting ENOBUFS. Bug: 34903085 Test: libappfuse Change-Id: I1602474d852e1599f6e69103bcf6f18277a5644b
* | Change FuseAppLoop so that it can process messages asynchronously.Daichi Hirono2017-03-283-227/+277
| | | | | | | | | | | | | | | | | | | | | | Previously FuseAppLoopCallback needs to return values in a synchrnous manner. The CL changes it to asynchronous mannger so that apps can process FUSE message asynchrnously. Bug: 35229514 Test: FuseAppLoopTest Change-Id: I8edcfdb003a25cfd5e9c490ec871140220b21e35 (cherry picked from commit f5d15f9fc4b8bd7a866660fe208bf857dea839ba)
* | Enable FuseBridgeLoop to accept new mount point after startingDaichi Hirono2017-03-234-77/+389
| | | | | | | | | | | | | | | | | | | | | | | | The CL turns StartFuseBridgeLoop function into FuseBridgeLoop class, and adds a method adding new appfuse mount to the loop. After doing this, one FuseBridgeLoop can process FUSE commands from multiple AppFuse mounts. Bug: 34903085 Test: libappfuse_test Change-Id: I54f11f54bc26c551281b9c32e9bb91f8f043774c
* | Add FuseMessage::WriteWithBody functionDaichi Hirono2017-03-222-42/+66
| | | | | | | | | | | | | | | | | | The funciton is going to be used to write FUSE header with external body. Bug: 35229514 Test: libappfuse_tests Change-Id: I303022b555deca960b8e08f26140a5ef10133efe
* | Add new EpollController class.Daichi Hirono2017-03-153-0/+117
| | | | | | | | | | | | | | | | | | | | The class is a thin wrapper for C epoll functions. Bug: 34903085 Test: Build EpollController.cc and libappfuse_test after applying future changes locally. Change-Id: Iedce7f35e4397f80cde1054d53261ad94f9e58a8
* | Add ReadOrAgain and WriteOrAgain methods to FuseMessage.Daichi Hirono2017-03-135-90/+148
|/ | | | | | | | | | | | | These methods return kAgain if operation cannot be done without blocking the current thread. The CL also introduecs new helper function SetupMessageSockets so that FuseMessages are always transfered via sockets that save message boundaries. Bug: 34903085 Test: libappfuse_test Change-Id: I34544372cc1b0c7bc9622e581ae16c018a123fa9
* Add permission bits to open() with O_CREAT.George Burgess IV2017-02-091-1/+1
| | | | | | | | | It's an error to pass open O_CREAT without giving it mode bits: https://linux.die.net/man/3/open Bug: 32073964 Test: Compiles with clang FORTIFY. Change-Id: I6b2a3694f85565afdeb782585c6af36e8c4d1557
* Support SOCK_STREAM for bridge between system and appDaichi Hirono2016-12-113-31/+64
| | | | | | | | | | | | | Previously AppFuse use SOCK_SEQPACKET for sockets communicating system and app. However SOCK_SEQPACKET requires the buffer of message size in the kernel and sometimes failed to write with ENOBUF. The CL updates libappfuse so that it can use SOCK_STREAM instead of SOCK_SEQPACKET. Bug: 33279206 Test: libappfuse_test Change-Id: I622ada9ac1d71d0c57b6cfff0904c7829cea7995
* Fix checks for reading and writing FuseMessage.Daichi Hirono2016-12-112-13/+27
| | | | | | | | | | | Previously FuseMessage were checking result of read/write operation after checking header.len value is valid. This was wrong because header.len does not contain correct value when read function does not read any bytes and returns zero. Bug: 33278098 Test: libappfuse_test Change-Id: Icf998ca6c3eeee20cbc4aa2f65195a87e59ffc27
* Remove FuseBridgeLoop class.Daichi Hirono2016-11-162-23/+8
| | | | | | Bug: 32779923 Test: libappfuse_test Change-Id: I29a76701d141ae061ec1fe32993d27460a0c694a
* Stops the loop when all files are closed.Daichi Hirono2016-11-162-4/+28
| | | | | | | | | | The CL changes FuseBridgeLoop so that it exits when all files opened on the AppFuse mount point are closed. Note that the client code will unmount the FUSE mount point after the loop exits. Bug: 32260320 Test: libappfuse_test Change-Id: I4965fbb48de8a280c6306e70757a07376b1956a7
* Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available."Treehugger Robot2016-11-152-11/+6
|\
| * Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available.Daichi Hirono2016-11-152-11/+6
| | | | | | | | | | | | | | | | | | | | | | We return the minor version number 15 to FUSE_INIT since we don't handle BATCH_FORGET. Thus the kernel does not accept the latest size of fuse_init_out. Instead we need to use FUSE_COMPAT_22_INIT_OUT_SIZE. Bug: 32779923 Test: libappfuse_test Change-Id: I5c979d0e45344ca8adfe3ad3f4a9561442abcb3a
* | Add static assert to check if FuseBuffer is standard layout union.Daichi Hirono2016-11-142-16/+26
| | | | | | | | | | | | Bug: 32260320 Test: libappfuse_test Change-Id: I6430c11fdeb2405996410c97044b4260c25209b8
* | Add FuseAppLoop to libappfuse.Daichi Hirono2016-11-1410-49/+678
|/ | | | | | | | | The class is used at the app side (StorageManager) to parse FUSE commands. Bug: 32260320 Test: libappfuse_test Change-Id: I1ae2904d3290a041f1efbf8fc10ba032eda5449c
* Add FuseBridgeLoop to libappfuse.Daichi Hirono2016-10-277-8/+336
| | | | | | | | | The CL adds FuseBridgeLoop class to libappfuse, which is used in the system service to proxy fuse commands to applications. Bug: 29970149 Test: libappfuse_test Change-Id: I0708f608b3868721ab16ba4028fd2c17a6735af7
* Add utility functions for FUSE.Daichi Hirono2016-10-264-0/+425
The CL adds utility functions to framework to parse FUSE messages from the kernel. The library will be used from framework JNI and service JNI. Bug: 32260320 Test: libappfuse_test Change-Id: Ib89b26d34789e6c26a3288beceb3ea145c1ae780