ext4: annotate all meta data requests
Today, storage devices like eMMC has special features like data tagging
(introduced in MMC-4.5 version) in order to improve performance of some
specific writes. On MMC stack, data tagging is used for all writes which has
REQ_META flag set. On EXT4, however, currently REQ_META is set only for read.
This patch adds the capability mark a meta-data buffer with set_buffer_meta
during meta data write. During submit_bh, this information is used to set
REQ_META flag.
Signed-off-by: Saugata Das <saugata.das@linaro.org>
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 90f7c2e..b09a308 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -107,6 +107,8 @@
{
int err = 0;
+ set_buffer_meta(bh);
+
if (ext4_handle_valid(handle)) {
err = jbd2_journal_dirty_metadata(handle, bh);
if (err) {
@@ -144,6 +146,8 @@
struct buffer_head *bh = EXT4_SB(sb)->s_sbh;
int err = 0;
+ set_buffer_meta(bh);
+
if (ext4_handle_valid(handle)) {
ext4_superblock_csum_set(sb,
(struct ext4_super_block *)bh->b_data);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 02bc8cb..a72a5a2 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4135,8 +4135,10 @@
err = __ext4_get_inode_loc(inode, &iloc, 0);
if (err)
return err;
- if (wbc->sync_mode == WB_SYNC_ALL)
+ if (wbc->sync_mode == WB_SYNC_ALL) {
+ set_buffer_meta(iloc.bh);
sync_dirty_buffer(iloc.bh);
+ }
if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) {
EXT4_ERROR_INODE_BLOCK(inode, iloc.bh->b_blocknr,
"IO error syncing inode");