diff options
Diffstat (limited to 'fs/ocfs2/uptodate.h')
-rw-r--r-- | fs/ocfs2/uptodate.h | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/fs/ocfs2/uptodate.h b/fs/ocfs2/uptodate.h index 531b4b3a0c47..0d826fe2da0d 100644 --- a/fs/ocfs2/uptodate.h +++ b/fs/ocfs2/uptodate.h | |||
@@ -26,24 +26,59 @@ | |||
26 | #ifndef OCFS2_UPTODATE_H | 26 | #ifndef OCFS2_UPTODATE_H |
27 | #define OCFS2_UPTODATE_H | 27 | #define OCFS2_UPTODATE_H |
28 | 28 | ||
29 | /* | ||
30 | * The caching code relies on locking provided by the user of | ||
31 | * struct ocfs2_caching_info. These operations connect that up. | ||
32 | */ | ||
33 | struct ocfs2_caching_operations { | ||
34 | /* | ||
35 | * A u64 representing the owning structure. Usually this | ||
36 | * is the block number (i_blkno or whatnot). This is used so | ||
37 | * that caching log messages can identify the owning structure. | ||
38 | */ | ||
39 | u64 (*co_owner)(struct ocfs2_caching_info *ci); | ||
40 | |||
41 | /* The superblock is needed during I/O. */ | ||
42 | struct super_block *(*co_get_super)(struct ocfs2_caching_info *ci); | ||
43 | /* | ||
44 | * Lock and unlock the caching data. These will not sleep, and | ||
45 | * should probably be spinlocks. | ||
46 | */ | ||
47 | void (*co_cache_lock)(struct ocfs2_caching_info *ci); | ||
48 | void (*co_cache_unlock)(struct ocfs2_caching_info *ci); | ||
49 | |||
50 | /* | ||
51 | * Lock and unlock for disk I/O. These will sleep, and should | ||
52 | * be mutexes. | ||
53 | */ | ||
54 | void (*co_io_lock)(struct ocfs2_caching_info *ci); | ||
55 | void (*co_io_unlock)(struct ocfs2_caching_info *ci); | ||
56 | }; | ||
57 | |||
29 | int __init init_ocfs2_uptodate_cache(void); | 58 | int __init init_ocfs2_uptodate_cache(void); |
30 | void exit_ocfs2_uptodate_cache(void); | 59 | void exit_ocfs2_uptodate_cache(void); |
31 | 60 | ||
32 | void ocfs2_metadata_cache_init(struct inode *inode); | 61 | void ocfs2_metadata_cache_init(struct ocfs2_caching_info *ci, |
33 | void ocfs2_metadata_cache_purge(struct inode *inode); | 62 | const struct ocfs2_caching_operations *ops); |
63 | void ocfs2_metadata_cache_purge(struct ocfs2_caching_info *ci); | ||
64 | void ocfs2_metadata_cache_exit(struct ocfs2_caching_info *ci); | ||
65 | |||
66 | u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci); | ||
67 | void ocfs2_metadata_cache_io_lock(struct ocfs2_caching_info *ci); | ||
68 | void ocfs2_metadata_cache_io_unlock(struct ocfs2_caching_info *ci); | ||
34 | 69 | ||
35 | int ocfs2_buffer_uptodate(struct inode *inode, | 70 | int ocfs2_buffer_uptodate(struct ocfs2_caching_info *ci, |
36 | struct buffer_head *bh); | 71 | struct buffer_head *bh); |
37 | void ocfs2_set_buffer_uptodate(struct inode *inode, | 72 | void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci, |
38 | struct buffer_head *bh); | 73 | struct buffer_head *bh); |
39 | void ocfs2_set_new_buffer_uptodate(struct inode *inode, | 74 | void ocfs2_set_new_buffer_uptodate(struct ocfs2_caching_info *ci, |
40 | struct buffer_head *bh); | 75 | struct buffer_head *bh); |
41 | void ocfs2_remove_from_cache(struct inode *inode, | 76 | void ocfs2_remove_from_cache(struct ocfs2_caching_info *ci, |
42 | struct buffer_head *bh); | 77 | struct buffer_head *bh); |
43 | void ocfs2_remove_xattr_clusters_from_cache(struct inode *inode, | 78 | void ocfs2_remove_xattr_clusters_from_cache(struct ocfs2_caching_info *ci, |
44 | sector_t block, | 79 | sector_t block, |
45 | u32 c_len); | 80 | u32 c_len); |
46 | int ocfs2_buffer_read_ahead(struct inode *inode, | 81 | int ocfs2_buffer_read_ahead(struct ocfs2_caching_info *ci, |
47 | struct buffer_head *bh); | 82 | struct buffer_head *bh); |
48 | 83 | ||
49 | #endif /* OCFS2_UPTODATE_H */ | 84 | #endif /* OCFS2_UPTODATE_H */ |