From patchwork Mon Dec 24 07:55:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC, 3/9, v1] ext4: add physical block and status member into extent status tree Date: Sun, 23 Dec 2012 21:55:36 -0000 From: Zheng Liu X-Patchwork-Id: 208038 Message-Id: <1356335742-11793-4-git-send-email-wenqing.lz@taobao.com> To: linux-ext4@vger.kernel.org Cc: Zheng Liu From: Zheng Liu es_pblk is used to record physical block that maps to the disk. es_status is used to record the status of the extent. Three status are defined, which are written, unwritten and delayed. Signed-off-by: Zheng Liu --- fs/ext4/extents_status.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h index 81e9339..85115bb 100644 --- a/fs/ext4/extents_status.h +++ b/fs/ext4/extents_status.h @@ -20,10 +20,18 @@ #define es_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) #endif +enum { + EXTENT_STATUS_WRITTEN = 0, /* written extent */ + EXTENT_STATUS_UNWRITTEN = 1, /* unwritten extent */ + EXTENT_STATUS_DELAYED = 2, /* delayed extent */ +}; + struct extent_status { struct rb_node rb_node; ext4_lblk_t es_lblk; /* first logical block extent covers */ ext4_lblk_t es_len; /* length of extent in block */ + ext4_fsblk_t es_pblk; /* first physical block */ + int es_status; /* record the status of extent */ }; struct ext4_es_tree {