]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/alloc.h
[GFS2] use lib/parser for parsing mount options
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / alloc.h
index bff2a162b0306e9012af25ea14217fb1e6ad8433..fbcb5934a0817e72ecc7bca583a3ae00b1ef1dae 100644 (file)
@@ -71,6 +71,8 @@ struct ocfs2_truncate_context {
        struct buffer_head *tc_last_eb_bh;
 };
 
+int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle,
+                                u64 new_i_size);
 int ocfs2_prepare_truncate(struct ocfs2_super *osb,
                           struct inode *inode,
                           struct buffer_head *fe_bh,
@@ -83,4 +85,23 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
 int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el,
                    u32 cpos, struct buffer_head **leaf_bh);
 
+/*
+ * Helper function to look at the # of clusters in an extent record.
+ */
+static inline unsigned int ocfs2_rec_clusters(struct ocfs2_extent_list *el,
+                                             struct ocfs2_extent_rec *rec)
+{
+       /*
+        * Cluster count in extent records is slightly different
+        * between interior nodes and leaf nodes. This is to support
+        * unwritten extents which need a flags field in leaf node
+        * records, thus shrinking the available space for a clusters
+        * field.
+        */
+       if (el->l_tree_depth)
+               return le32_to_cpu(rec->e_int_clusters);
+       else
+               return le16_to_cpu(rec->e_leaf_clusters);
+}
+
 #endif /* OCFS2_ALLOC_H */