ext4: mark metadata blocks using bh flags
authorTheodore Ts'o <tytso@mit.edu>
Sun, 21 Apr 2013 20:45:54 +0000 (16:45 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 21 Apr 2013 20:45:54 +0000 (16:45 -0400)
This allows metadata writebacks which are issued via block device
writeback to be sent with the current write request flags.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4_jbd2.c
fs/ext4/inode.c

index 0e1dc9e70ce52da060f3477d0ce56e5b0b101c73..451eb404533095fc323218fe5ea0f3caa0af8b16 100644 (file)
@@ -215,6 +215,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
 
        might_sleep();
 
+       set_buffer_meta(bh);
+       set_buffer_prio(bh);
        if (ext4_handle_valid(handle)) {
                err = jbd2_journal_dirty_metadata(handle, bh);
                if (err) {
index 62492e95448314ed666cde91aca7dd06ba5b3d69..d7518e2728f1f5bbe5b6723057a8da997a8e0851 100644 (file)
@@ -1080,10 +1080,14 @@ retry_journal:
 /* For write_end() in data=journal mode */
 static int write_end_fn(handle_t *handle, struct buffer_head *bh)
 {
+       int ret;
        if (!buffer_mapped(bh) || buffer_freed(bh))
                return 0;
        set_buffer_uptodate(bh);
-       return ext4_handle_dirty_metadata(handle, NULL, bh);
+       ret = ext4_handle_dirty_metadata(handle, NULL, bh);
+       clear_buffer_meta(bh);
+       clear_buffer_prio(bh);
+       return ret;
 }
 
 /*