aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2009-07-02 12:26:36 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2009-07-02 12:26:36 +0000
commit24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6 (patch)
tree0ebcdf18f18a07ab444c4707f8091b615fd23171 /include
parent5bd3ba41e55e8c52e04d730d1e8a924b23b21591 (diff)
downloadandroid_external_fuse-24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6.tar.gz
android_external_fuse-24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6.tar.bz2
android_external_fuse-24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6.zip
* The context is extended with a 'umask' field. The umask is sent
for mknod, mkdir and create requests by linux kernel version 2.6.31 or later, otherwise the umask is set to zero. Also introduce a new feature flag: FUSE_CAP_DONT_MASK. If the kernel supports this feature, then this flag will be set in conn->capable in the ->init() method. If the filesystem sets this flag in in conn->want, then the create modes will not be masked. * Add low level interfaces for lookup cache and attribute invalidation. This feature is available in linux kernels 2.6.31 or later. Patch by John Muir * Kernel interface version is now 7.12
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h3
-rw-r--r--include/fuse_common.h2
-rw-r--r--include/fuse_kernel.h37
-rw-r--r--include/fuse_lowlevel.h37
4 files changed, 77 insertions, 2 deletions
diff --git a/include/fuse.h b/include/fuse.h
index a58cd9f..7429922 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -518,6 +518,9 @@ struct fuse_context {
/** Private filesystem data */
void *private_data;
+
+ /** Umask of the calling process (introduced in version 2.8) */
+ mode_t umask;
};
/**
diff --git a/include/fuse_common.h b/include/fuse_common.h
index ba341b3..291d1b7 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -88,12 +88,14 @@ struct fuse_file_info {
* FUSE_CAP_ATOMIC_O_TRUNC: filesystem handles the O_TRUNC open flag
* FUSE_CAP_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
* FUSE_CAP_BIG_WRITES: filesystem can handle write size larger than 4kB
+ * FUSE_CAP_DONT_MASK: don't apply umask to file mode on create operations
*/
#define FUSE_CAP_ASYNC_READ (1 << 0)
#define FUSE_CAP_POSIX_LOCKS (1 << 1)
#define FUSE_CAP_ATOMIC_O_TRUNC (1 << 3)
#define FUSE_CAP_EXPORT_SUPPORT (1 << 4)
#define FUSE_CAP_BIG_WRITES (1 << 5)
+#define FUSE_CAP_DONT_MASK (1 << 6)
/**
* Ioctl flags
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
index 541364f..dac35d8 100644
--- a/include/fuse_kernel.h
+++ b/include/fuse_kernel.h
@@ -51,6 +51,11 @@
* - add IOCTL message
* - add unsolicited notification support
* - add POLL message and NOTIFY_POLL notification
+ *
+ * 7.12
+ * - add umask flag to input argument of open, mknod and mkdir
+ * - add notification messages for invalidation of inodes and
+ * directory entries
*/
#ifndef _LINUX_FUSE_H
@@ -58,6 +63,7 @@
#include <sys/types.h>
#define __u64 uint64_t
+#define __s64 int64_t
#define __u32 uint32_t
#define __s32 int32_t
@@ -65,7 +71,7 @@
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 11
+#define FUSE_KERNEL_MINOR_VERSION 12
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
@@ -141,6 +147,7 @@ struct fuse_file_lock {
* INIT request/reply flags
*
* FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
+ * FUSE_DONT_MASK: don't apply umask to file mode on create operations
*/
#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
@@ -148,6 +155,7 @@ struct fuse_file_lock {
#define FUSE_ATOMIC_O_TRUNC (1 << 3)
#define FUSE_EXPORT_SUPPORT (1 << 4)
#define FUSE_BIG_WRITES (1 << 5)
+#define FUSE_DONT_MASK (1 << 6)
/**
* CUSE INIT request/reply flags
@@ -253,6 +261,8 @@ enum fuse_opcode {
enum fuse_notify_code {
FUSE_NOTIFY_POLL = 1,
+ FUSE_NOTIFY_INVAL_INODE = 2,
+ FUSE_NOTIFY_INVAL_ENTRY = 3,
FUSE_NOTIFY_CODE_MAX,
};
@@ -291,14 +301,18 @@ struct fuse_attr_out {
struct fuse_attr attr;
};
+#define FUSE_COMPAT_MKNOD_IN_SIZE 8
+
struct fuse_mknod_in {
__u32 mode;
__u32 rdev;
+ __u32 umask;
+ __u32 padding;
};
struct fuse_mkdir_in {
__u32 mode;
- __u32 padding;
+ __u32 umask;
};
struct fuse_rename_in {
@@ -330,7 +344,14 @@ struct fuse_setattr_in {
struct fuse_open_in {
__u32 flags;
+ __u32 unused;
+};
+
+struct fuse_create_in {
+ __u32 flags;
__u32 mode;
+ __u32 umask;
+ __u32 padding;
};
struct fuse_open_out {
@@ -537,4 +558,16 @@ struct fuse_dirent {
#define FUSE_DIRENT_SIZE(d) \
FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
+struct fuse_notify_inval_inode_out {
+ __u64 ino;
+ __s64 off;
+ __s64 len;
+};
+
+struct fuse_notify_inval_entry_out {
+ __u64 parent;
+ __u32 namelen;
+ __u32 padding;
+};
+
#endif /* _LINUX_FUSE_H */
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index a495e15..8c04cd4 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -109,6 +109,9 @@ struct fuse_ctx {
/** Thread ID of the calling process */
pid_t pid;
+
+ /** Umask of the calling process (introduced in version 2.8) */
+ mode_t umask;
};
/* 'to_set' flags in setattr */
@@ -1151,6 +1154,32 @@ int fuse_reply_poll(fuse_req_t req, unsigned revents);
*/
int fuse_lowlevel_notify_poll(struct fuse_pollhandle *ph);
+/**
+ * Notify to invalidate cache for an inode
+ *
+ * @param ch the channel through which to send the invalidation
+ * @param ino the inode number
+ * @param off the offset in the inode where to start invalidating
+ * or negative to invalidate attributes only
+ * @param len the amount of cache to invalidate or 0 for all
+ * @return zero for success, -errno for failure
+ */
+int fuse_lowlevel_notify_inval_inode(struct fuse_chan *ch, fuse_ino_t ino,
+ off_t off, off_t len);
+
+/**
+ * Notify to invalidate parent attributes and the dentry matching
+ * parent/name
+ *
+ * @param ch the channel through which to send the invalidation
+ * @param parent inode number
+ * @param name file name
+ * @param namelen strlen() of file name
+ * @return zero for success, -errno for failure
+ */
+int fuse_lowlevel_notify_inval_entry(struct fuse_chan *ch, fuse_ino_t parent,
+ const char *name, size_t namelen);
+
/* ----------------------------------------------------------- *
* Utility functions *
* ----------------------------------------------------------- */
@@ -1376,6 +1405,14 @@ void fuse_session_reset(struct fuse_session *se);
int fuse_session_exited(struct fuse_session *se);
/**
+ * Get the user data provided to the session
+ *
+ * @param se the session
+ * @return the user data
+ */
+void *fuse_session_data(struct fuse_session *se);
+
+/**
* Enter a single threaded event loop
*
* @param se the session