From 24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 2 Jul 2009 12:26:36 +0000 Subject: * 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 --- include/fuse_lowlevel.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'include/fuse_lowlevel.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 * * ----------------------------------------------------------- */ @@ -1375,6 +1404,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 * -- cgit v1.2.3