summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2_fs.h
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2009-08-11 08:33:14 +0200
committerJoel Becker <joel.becker@oracle.com>2009-09-23 05:09:33 +0200
commite73a819db9c2d6c4065b7cab7374709b6939e8f1 (patch)
tree40968bc5b37d3b55e382267683c9612d4697f036 /fs/ocfs2/ocfs2_fs.h
parentocfs2: move tree path functions to alloc.h. (diff)
downloadlinux-e73a819db9c2d6c4065b7cab7374709b6939e8f1.tar.xz
linux-e73a819db9c2d6c4065b7cab7374709b6939e8f1.zip
ocfs2: Add support for incrementing refcount in the tree.
Given a physical cpos and length, increment the refcount in the tree. If the extent has not been seen before, a refcount record is created for it. Refcount records may be merged or split by this operation. Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2_fs.h')
-rw-r--r--fs/ocfs2/ocfs2_fs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index e4288b446ec0..40072cdef7b6 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -916,6 +916,7 @@ struct ocfs2_refcount_rec {
__le32 r_refcount; /* Reference count of this extent */
/*10*/
};
+#define OCFS2_32BIT_POS_MASK (0xffffffffULL)
#define OCFS2_REFCOUNT_LEAF_FL (0x00000001)
#define OCFS2_REFCOUNT_TREE_FL (0x00000002)
@@ -1394,6 +1395,12 @@ static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)
return size / sizeof(struct ocfs2_refcount_rec);
}
+
+static inline u32
+ocfs2_get_ref_rec_low_cpos(const struct ocfs2_refcount_rec *rec)
+{
+ return le64_to_cpu(rec->r_cpos) & OCFS2_32BIT_POS_MASK;
+}
#else
static inline int ocfs2_fast_symlink_chars(int blocksize)
{