diff options
author | John Muir <muirj@nortel.com> | 2009-05-31 11:13:57 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2009-06-30 14:12:24 -0400 |
commit | 3b463ae0c6264f70e5d4c0a9c46af20fed43c96e (patch) | |
tree | 03c6abdd0671d74452cbd1f6fc6d637363eb6389 /include | |
parent | e0a43ddcc08c34dbd666d93600fd23914505f4aa (diff) |
fuse: invalidation reverse calls
Add notification messages that allow the filesystem to invalidate VFS
caches.
Two notifications are added:
1) inode invalidation
- invalidate cached attributes
- invalidate a range of pages in the page cache (this is optional)
2) dentry invalidation
- try to invalidate a subtree in the dentry cache
Care must be taken while accessing the 'struct super_block' for the
mount, as it can go away while an invalidation is in progress. To
prevent this, introduce a rw-semaphore, that is taken for read during
the invalidation and taken for write in the ->kill_sb callback.
Cc: Csaba Henk <csaba@gluster.com>
Cc: Anand Avati <avati@zresearch.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fuse.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index e2b816a62488..cf593bf9fd32 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -28,6 +28,8 @@ | |||
28 | * | 28 | * |
29 | * 7.12 | 29 | * 7.12 |
30 | * - add umask flag to input argument of open, mknod and mkdir | 30 | * - add umask flag to input argument of open, mknod and mkdir |
31 | * - add notification messages for invalidation of inodes and | ||
32 | * directory entries | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef _LINUX_FUSE_H | 35 | #ifndef _LINUX_FUSE_H |
@@ -229,6 +231,8 @@ enum fuse_opcode { | |||
229 | 231 | ||
230 | enum fuse_notify_code { | 232 | enum fuse_notify_code { |
231 | FUSE_NOTIFY_POLL = 1, | 233 | FUSE_NOTIFY_POLL = 1, |
234 | FUSE_NOTIFY_INVAL_INODE = 2, | ||
235 | FUSE_NOTIFY_INVAL_ENTRY = 3, | ||
232 | FUSE_NOTIFY_CODE_MAX, | 236 | FUSE_NOTIFY_CODE_MAX, |
233 | }; | 237 | }; |
234 | 238 | ||
@@ -524,4 +528,16 @@ struct fuse_dirent { | |||
524 | #define FUSE_DIRENT_SIZE(d) \ | 528 | #define FUSE_DIRENT_SIZE(d) \ |
525 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 529 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
526 | 530 | ||
531 | struct fuse_notify_inval_inode_out { | ||
532 | __u64 ino; | ||
533 | __s64 off; | ||
534 | __s64 len; | ||
535 | }; | ||
536 | |||
537 | struct fuse_notify_inval_entry_out { | ||
538 | __u64 parent; | ||
539 | __u32 namelen; | ||
540 | __u32 padding; | ||
541 | }; | ||
542 | |||
527 | #endif /* _LINUX_FUSE_H */ | 543 | #endif /* _LINUX_FUSE_H */ |