提交 721f69c4 编写于 作者: T Tao Ma 提交者: Joel Becker

ocfs2: Define refcount tree structure.

Signed-off-by: NTao Ma <tao.ma@oracle.com>
上级 5e404e9e
master alk-4.19.24 alk-4.19.30 alk-4.19.34 alk-4.19.36 alk-4.19.43 alk-4.19.48 alk-4.19.57 ck-4.19.67 ck-4.19.81 ck-4.19.91 github/fork/deepanshu1422/fix-typo-in-comment github/fork/haosdent/fix-typo linux-next v4.19.91 v4.19.90 v4.19.89 v4.19.88 v4.19.87 v4.19.86 v4.19.85 v4.19.84 v4.19.83 v4.19.82 v4.19.81 v4.19.80 v4.19.79 v4.19.78 v4.19.77 v4.19.76 v4.19.75 v4.19.74 v4.19.73 v4.19.72 v4.19.71 v4.19.70 v4.19.69 v4.19.68 v4.19.67 v4.19.66 v4.19.65 v4.19.64 v4.19.63 v4.19.62 v4.19.61 v4.19.60 v4.19.59 v4.19.58 v4.19.57 v4.19.56 v4.19.55 v4.19.54 v4.19.53 v4.19.52 v4.19.51 v4.19.50 v4.19.49 v4.19.48 v4.19.47 v4.19.46 v4.19.45 v4.19.44 v4.19.43 v4.19.42 v4.19.41 v4.19.40 v4.19.39 v4.19.38 v4.19.37 v4.19.36 v4.19.35 v4.19.34 v4.19.33 v4.19.32 v4.19.31 v4.19.30 v4.19.29 v4.19.28 v4.19.27 v4.19.26 v4.19.25 v4.19.24 v4.19.23 v4.19.22 v4.19.21 v4.19.20 v4.19.19 v4.19.18 v4.19.17 v4.19.16 v4.19.15 v4.19.14 v4.19.13 v4.19.12 v4.19.11 v4.19.10 v4.19.9 v4.19.8 v4.19.7 v4.19.6 v4.19.5 v4.19.4 v4.19.3 v4.19.2 v4.19.1 v4.19 v4.19-rc8 v4.19-rc7 v4.19-rc6 v4.19-rc5 v4.19-rc4 v4.19-rc3 v4.19-rc2 v4.19-rc1 ck-release-21 ck-release-20 ck-release-19.2 ck-release-19.1 ck-release-19 ck-release-18 ck-release-17.2 ck-release-17.1 ck-release-17 ck-release-16 ck-release-15.1 ck-release-15 ck-release-14 ck-release-13.2 ck-release-13 ck-release-12 ck-release-11 ck-release-10 ck-release-9 ck-release-7 alk-release-15 alk-release-14 alk-release-13.2 alk-release-13 alk-release-12 alk-release-11 alk-release-10 alk-release-9 alk-release-7
无相关合并请求
......@@ -68,6 +68,7 @@
#define OCFS2_DIR_TRAILER_SIGNATURE "DIRTRL1"
#define OCFS2_DX_ROOT_SIGNATURE "DXDIR01"
#define OCFS2_DX_LEAF_SIGNATURE "DXLEAF1"
#define OCFS2_REFCOUNT_BLOCK_SIGNATURE "REFCNT1"
/* Compatibility flags */
#define OCFS2_HAS_COMPAT_FEATURE(sb,mask) \
......@@ -160,6 +161,9 @@
/* Metadata checksum and error correction */
#define OCFS2_FEATURE_INCOMPAT_META_ECC 0x0800
/* Refcount tree support */
#define OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE 0x1000
/*
* backup superblock flag is used to indicate that this volume
* has backup superblocks.
......@@ -223,6 +227,7 @@
#define OCFS2_HAS_XATTR_FL (0x0002)
#define OCFS2_INLINE_XATTR_FL (0x0004)
#define OCFS2_INDEXED_DIR_FL (0x0008)
#define OCFS2_HAS_REFCOUNT_FL (0x0010)
/* Inode attributes, keep in sync with EXT2 */
#define OCFS2_SECRM_FL (0x00000001) /* Secure deletion */
......@@ -241,8 +246,11 @@
/*
* Extent record flags (e_node.leaf.flags)
*/
#define OCFS2_EXT_UNWRITTEN (0x01) /* Extent is allocated but
* unwritten */
#define OCFS2_EXT_UNWRITTEN (0x01) /* Extent is allocated but
* unwritten */
#define OCFS2_EXT_REFCOUNTED (0x02) /* Extent is reference
* counted in an associated
* refcount tree */
/*
* ioctl commands
......@@ -717,7 +725,8 @@ struct ocfs2_dinode {
__le64 i_xattr_loc;
/*80*/ struct ocfs2_block_check i_check; /* Error checking */
/*88*/ __le64 i_dx_root; /* Pointer to dir index root block */
__le64 i_reserved2[5];
/*90*/ __le64 i_refcount_loc;
__le64 i_reserved2[4];
/*B8*/ union {
__le64 i_pad1; /* Generic way to refer to this
64bit union */
......@@ -901,6 +910,59 @@ struct ocfs2_group_desc
/*40*/ __u8 bg_bitmap[0];
};
struct ocfs2_refcount_rec {
/*00*/ __le64 r_cpos; /* Physical offset, in clusters */
__le32 r_clusters; /* Clusters covered by this extent */
__le32 r_refcount; /* Reference count of this extent */
/*10*/
};
#define OCFS2_REFCOUNT_LEAF_FL (0x00000001)
#define OCFS2_REFCOUNT_TREE_FL (0x00000002)
struct ocfs2_refcount_list {
/*00*/ __le16 rl_count; /* Maximum number of entries possible
in rl_records */
__le16 rl_used; /* Current number of used records */
__le32 rl_reserved2;
__le64 rl_reserved1; /* Pad to sizeof(ocfs2_refcount_record) */
/*10*/ struct ocfs2_refcount_rec rl_recs[0]; /* Refcount records */
};
struct ocfs2_refcount_block {
/*00*/ __u8 rf_signature[8]; /* Signature for verification */
__le16 rf_suballoc_slot; /* Slot suballocator this block
belongs to */
__le16 rf_suballoc_bit; /* Bit offset in suballocator
block group */
__le32 rf_fs_generation; /* Must match superblock */
/*10*/ __le64 rf_blkno; /* Offset on disk, in blocks */
__le64 rf_parent; /* Parent block, only valid if
OCFS2_REFCOUNT_LEAF_FL is set in
rf_flags */
/*20*/ struct ocfs2_block_check rf_check; /* Error checking */
__le64 rf_last_eb_blk; /* Pointer to last extent block */
/*30*/ __le32 rf_count; /* Number of inodes sharing this
refcount tree */
__le32 rf_flags; /* See the flags above */
__le32 rf_clusters; /* clusters covered by refcount tree. */
__le32 rf_cpos; /* cluster offset in refcount tree.*/
/*40*/ __le32 rf_generation; /* generation number. all be the same
* for the same refcount tree. */
__le32 rf_reserved0;
__le64 rf_reserved1[7];
/*80*/ union {
struct ocfs2_refcount_list rf_records; /* List of refcount
records */
struct ocfs2_extent_list rf_list; /* Extent record list,
only valid if
OCFS2_REFCOUNT_TREE_FL
is set in rf_flags */
};
/* Actual on-disk size is one block */
};
/*
* On disk extended attribute structure for OCFS2.
*/
......@@ -1312,6 +1374,26 @@ static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb)
return size / sizeof(struct ocfs2_extent_rec);
}
static inline u16 ocfs2_extent_recs_per_rb(struct super_block *sb)
{
int size;
size = sb->s_blocksize -
offsetof(struct ocfs2_refcount_block, rf_list.l_recs);
return size / sizeof(struct ocfs2_extent_rec);
}
static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)
{
int size;
size = sb->s_blocksize -
offsetof(struct ocfs2_refcount_block, rf_records.rl_recs);
return size / sizeof(struct ocfs2_refcount_rec);
}
#else
static inline int ocfs2_fast_symlink_chars(int blocksize)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部