diff options
Diffstat (limited to 'include/fuse_lowlevel.h')
-rw-r--r-- | include/fuse_lowlevel.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index cceb9be..6bad70e 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -127,6 +127,15 @@ struct fuse_forget_data { uint64_t nlookup; }; +/** + * Flags for fuse_lowlevel_notify_expire_entry() + * 0 = invalidate entry + * FUSE_LL_EXPIRE_ONLY = expire entry +*/ +enum fuse_expire_flags { + FUSE_LL_EXPIRE_ONLY = (1 << 0), +}; + /* 'to_set' flags in setattr */ #define FUSE_SET_ATTR_MODE (1 << 0) #define FUSE_SET_ATTR_UID (1 << 1) @@ -1675,10 +1684,33 @@ int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t ino, int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent, const char *name, size_t namelen); -enum fuse_expire_flags { - FUSE_LL_EXPIRE_ONLY = (1 << 0), -}; - +/** + * Notify to expire or invalidate parent attributes and the dentry + * matching parent/name + * + * Underlying function for fuse_lowlevel_notify_inval_entry(). + * + * In addition to invalidating an entry, it also allows to expire an entry. + * In that case, the entry is not forcefully removed from kernel cache + * but instead the next access to it forces a lookup from the filesystem. + * + * This makes a difference for overmounted dentries, where plain invalidation + * would detach all submounts before dropping the dentry from the cache. + * If only expiry is set on the dentry, then any overmounts are left alone and + * until ->d_revalidate() is called. + * + * Note: ->d_revalidate() is not called for the case of following a submount, + * so invalidation will only be triggered for the non-overmounted case. + * The dentry could also be mounted in a different mount instance, in which case + * any submounts will still be detached. + * + * @param se the session object + * @param parent inode number + * @param name file name + * @param namelen strlen() of file name + * @param flags flags to control if the entry should be expired or invalidated + * @return zero for success, -errno for failure +*/ int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent, const char *name, size_t namelen, enum fuse_expire_flags flags); |