aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2020-01-10 14:56:15 +0000
committerZim <zezeozue@google.com>2020-01-10 16:28:23 +0000
commit29c1808ed132bd003b34166912d9da0dcccc4e83 (patch)
treec7343107736f5b34e9b76d33f83c45d3462fd061 /include
parent1614f394fb59a7e1f0669fd1adfc385e3384023c (diff)
downloadlibfuse-29c1808ed132bd003b34166912d9da0dcccc4e83.tar.gz
Support FUSE_CANONICAL_PATH in libfuse
FUSE_CANONICAL_PATH opcode, (2016) was added in some Android kernels to support inotify. Add canonical path handlers in libfuse and create a patch file to easily apply this patch on top of updates. Test: inotify - /sdcard on Taimen Test: atest FileObserver Bug: 147482155 Change-Id: I97a2c4247aa3e4a70af697569b56662a0755f72b
Diffstat (limited to 'include')
-rw-r--r--include/fuse_kernel.h3
-rw-r--r--include/fuse_lowlevel.h24
2 files changed, 27 insertions, 0 deletions
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
index 2971d29..8a45f42 100644
--- a/include/fuse_kernel.h
+++ b/include/fuse_kernel.h
@@ -425,6 +425,9 @@ enum fuse_opcode {
/* CUSE specific operations */
CUSE_INIT = 4096,
+
+ /* Android specific operations */
+ FUSE_CANONICAL_PATH = 2016,
};
enum fuse_notify_code {
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 18c6363..e81c282 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -317,6 +317,18 @@ struct fuse_lowlevel_ops {
*/
void (*readlink) (fuse_req_t req, fuse_ino_t ino);
+ /**
+ * Return canonical path for inotify
+ *
+ * Valid replies:
+ * fuse_reply_canonical_path
+ * fuse_reply_err
+ *
+ * @param req request handle
+ * @param ino the inode number
+ */
+ void (*canonical_path) (fuse_req_t req, fuse_ino_t ino);
+
/**
* Create file node
*
@@ -1338,6 +1350,18 @@ int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
int fuse_reply_readlink(fuse_req_t req, const char *link);
/**
+ * Reply with the canonical path for inotify
+ *
+ * Possible requests:
+ * canonical_path
+ *
+ * @param req request handle
+ * @param path to canonicalize
+ * @return zero for success, -errno for failure to send reply
+ */
+int fuse_reply_canonical_path(fuse_req_t req, const char *path);
+
+/**
* Reply with open parameters
*
* currently the following members of 'fi' are used: