aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/extent_map.h
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-04-23 21:53:12 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-04-26 18:10:40 -0400
commit83418978827324918a8cd25ce5227312de1d4468 (patch)
treef7baefb1fc8721d6d8d1f1f937bc55535b13e18f /fs/ocfs2/extent_map.h
parent7cdfc3a1c3971c9125c317cb8c2525745851798e (diff)
ocfs2: Cache extent records
The extent map code was ripped out earlier because of an inability to deal with holes. This patch adds back a simpler caching scheme requiring far less code. Our old extent map caching was designed back when meta data block caching in Ocfs2 didn't work very well, resulting in many disk reads. These days our metadata caching is much better, resulting in no un-necessary disk reads. As a result, extent caching doesn't have to be as fancy, nor does it have to cache as many extents. Keeping the last 3 extents seen should be sufficient to give us a small performance boost on some streaming workloads. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/extent_map.h')
-rw-r--r--fs/ocfs2/extent_map.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ocfs2/extent_map.h b/fs/ocfs2/extent_map.h
index 1d745e174afc..de91e3e41a22 100644
--- a/fs/ocfs2/extent_map.h
+++ b/fs/ocfs2/extent_map.h
@@ -25,6 +25,26 @@
25#ifndef _EXTENT_MAP_H 25#ifndef _EXTENT_MAP_H
26#define _EXTENT_MAP_H 26#define _EXTENT_MAP_H
27 27
28struct ocfs2_extent_map_item {
29 unsigned int ei_cpos;
30 unsigned int ei_phys;
31 unsigned int ei_clusters;
32 unsigned int ei_flags;
33
34 struct list_head ei_list;
35};
36
37#define OCFS2_MAX_EXTENT_MAP_ITEMS 3
38struct ocfs2_extent_map {
39 unsigned int em_num_items;
40 struct list_head em_list;
41};
42
43void ocfs2_extent_map_init(struct inode *inode);
44void ocfs2_extent_map_trunc(struct inode *inode, unsigned int cluster);
45void ocfs2_extent_map_insert_rec(struct inode *inode,
46 struct ocfs2_extent_rec *rec);
47
28int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, u32 *p_cluster, 48int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, u32 *p_cluster,
29 u32 *num_clusters, unsigned int *extent_flags); 49 u32 *num_clusters, unsigned int *extent_flags);
30int ocfs2_extent_map_get_blocks(struct inode *inode, u64 v_blkno, u64 *p_blkno, 50int ocfs2_extent_map_get_blocks(struct inode *inode, u64 v_blkno, u64 *p_blkno,