aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.h
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-03-07 19:46:57 -0500
committerMark Fasheh <mark.fasheh@oracle.com>2007-04-26 18:02:37 -0400
commite48edee2d8eab812f31f0ff62c6ba635ca2e1e21 (patch)
tree6afb9fe59a06ce621cb11d570e432e7d739376ff /fs/ocfs2/alloc.h
parent6af67d8205cf65fbaaa743edc7ebb46e486e34ff (diff)
ocfs2: make room for unwritten extents flag
Due to the size of our group bitmaps, we'll never have a leaf node extent record with more than 16 bits worth of clusters. Split e_clusters up so that leaf nodes can get a flags field where we can mark unwritten extents. Interior nodes whose length references all the child nodes beneath it can't split their e_clusters field, so we use a union to preserve sizing there. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/alloc.h')
-rw-r--r--fs/ocfs2/alloc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h
index 3cb39cd5e478..fbcb5934a081 100644
--- a/fs/ocfs2/alloc.h
+++ b/fs/ocfs2/alloc.h
@@ -85,4 +85,23 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
85int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el, 85int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el,
86 u32 cpos, struct buffer_head **leaf_bh); 86 u32 cpos, struct buffer_head **leaf_bh);
87 87
88/*
89 * Helper function to look at the # of clusters in an extent record.
90 */
91static inline unsigned int ocfs2_rec_clusters(struct ocfs2_extent_list *el,
92 struct ocfs2_extent_rec *rec)
93{
94 /*
95 * Cluster count in extent records is slightly different
96 * between interior nodes and leaf nodes. This is to support
97 * unwritten extents which need a flags field in leaf node
98 * records, thus shrinking the available space for a clusters
99 * field.
100 */
101 if (el->l_tree_depth)
102 return le32_to_cpu(rec->e_int_clusters);
103 else
104 return le16_to_cpu(rec->e_leaf_clusters);
105}
106
88#endif /* OCFS2_ALLOC_H */ 107#endif /* OCFS2_ALLOC_H */