Message ID | 1357901627-3068-4-git-send-email-wenqing.lz@taobao.com |
---|---|
State | Superseded, archived |
Headers | show |
On Fri, Jan 11, 2013 at 06:53:43PM +0800, Zheng Liu wrote: > 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 */ > }; Given that we only support 48 bits for the physical block number, and we only need two bits for es_status, one thing we could do to save memory is to stash the es_status bits in the top two bits of es_pblk. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jan 16, 2013 at 11:42:13PM -0500, Theodore Ts'o wrote: > On Fri, Jan 11, 2013 at 06:53:43PM +0800, Zheng Liu wrote: > > 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 */ > > }; > > Given that we only support 48 bits for the physical block number, and > we only need two bits for es_status, one thing we could do to save > memory is to stash the es_status bits in the top two bits of es_pblk. Thanks for the comment. In next version, es_status will be stashed into es_pblk. Regards, - Zheng -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 {