diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-05-13 16:29:40 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-13 16:29:40 +0000 |
commit | 7fdddf2190c5c3cc7c7d4ffd103199b4803fa028 (patch) | |
tree | 3e5075efec3f16265f9fe0bdf93d9bb0cdce7107 | |
parent | 1b8b7b64682085dbfb224e4413c19ab8425dfc73 (diff) | |
parent | 48ea17ee4b4cc770738c7b667c2f545d375dc383 (diff) | |
download | libfuse-android12-mainline-networkstack-release.tar.gz |
Merge "Introduce API V2 for FUSE_PASSTHROUGH_OPEN" into sc-dev am: 48ea17ee4bandroid-mainline-12.0.0_r99android-mainline-12.0.0_r98android-mainline-12.0.0_r77android-mainline-12.0.0_r70android-mainline-12.0.0_r69android-mainline-12.0.0_r63android-mainline-12.0.0_r59android-mainline-12.0.0_r56android-mainline-12.0.0_r5android-mainline-12.0.0_r49android-mainline-12.0.0_r42android-mainline-12.0.0_r39android-mainline-12.0.0_r22android-mainline-12.0.0_r19android-mainline-12.0.0_r122android-mainline-12.0.0_r115android-mainline-12.0.0_r113android-mainline-12.0.0_r100aml_tz3_311312010android12-mainline-networkstack-releaseandroid12-mainline-art-release
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/libfuse/+/14529475
Change-Id: I4e83cbd647b1fb1484fbe543fab7f83e44b33735
-rw-r--r-- | include/fuse_kernel.h | 1 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index 55d8e2c..bd8794e 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -836,6 +836,7 @@ struct fuse_notify_retrieve_in { #define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t) #define FUSE_DEV_IOC_PASSTHROUGH_OPEN_V0 _IOW(229, 1, struct fuse_passthrough_out_v0) #define FUSE_DEV_IOC_PASSTHROUGH_OPEN_V1 _IOW(229, 127, struct fuse_passthrough_out_v0) +#define FUSE_DEV_IOC_PASSTHROUGH_OPEN_V2 _IOW(229, 126, uint32_t) struct fuse_lseek_in { uint64_t fh; diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index baa6d2b..a4a4df0 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -463,6 +463,7 @@ enum { FUSE_PASSTHROUGH_API_UNAVAILABLE, FUSE_PASSTHROUGH_API_V0, FUSE_PASSTHROUGH_API_V1, + FUSE_PASSTHROUGH_API_V2, FUSE_PASSTHROUGH_API_STABLE, }; @@ -490,7 +491,14 @@ int fuse_passthrough_enable(fuse_req_t req, unsigned int fd) { switch (passthrough_version) { case FUSE_PASSTHROUGH_API_STABLE: /* There is not a stable API yet */ - passthrough_version = FUSE_PASSTHROUGH_API_V1; + passthrough_version = FUSE_PASSTHROUGH_API_V2; + case FUSE_PASSTHROUGH_API_V2: { + ret = ioctl(req->se->fd, FUSE_DEV_IOC_PASSTHROUGH_OPEN_V2, &fd); + if (ret == -1 && errno == ENOTTY) + passthrough_version = FUSE_PASSTHROUGH_API_V1; + else + break; + } case FUSE_PASSTHROUGH_API_V1: { struct fuse_passthrough_out_v0 out = {}; out.fd = fd; |