WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch 6/6] xenblk: Add O_DIRECT and O_SYNC support -- for j

[patch 6/6] xenblk: Add O_DIRECT and O_SYNC support -- for jbd.

Journal data always need sync to disk as soon as possible, so set all
jbd write buffer_head to BH_Sync_Write.

Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
---

diff -r 2fb13b8cbe13 fs/jbd/checkpoint.c
--- a/fs/jbd/checkpoint.c       Thu Oct 30 13:34:43 2008 +0000
+++ b/fs/jbd/checkpoint.c       Tue Nov 04 10:43:59 2008 +0800
@@ -211,6 +211,8 @@
 {
        int i;
 
+       for (i = 0; i < *batch_count; i++) 
+               mark_sync_write_bh(bhs[i]);
        ll_rw_block(SWRITE, *batch_count, bhs);
        for (i = 0; i < *batch_count; i++) {
                struct buffer_head *bh = bhs[i];
diff -r 2fb13b8cbe13 fs/jbd/commit.c
--- a/fs/jbd/commit.c   Thu Oct 30 13:34:43 2008 +0000
+++ b/fs/jbd/commit.c   Tue Nov 04 10:43:59 2008 +0800
@@ -166,6 +166,7 @@
 
        for (i = 0; i < bufs; i++) {
                wbuf[i]->b_end_io = end_buffer_write_sync;
+               set_buffer_sync_write(wbuf[i]);
                /* We use-up our safety reference in submit_bh() */
                submit_bh(WRITE, wbuf[i]);
        }
@@ -631,6 +632,7 @@
                                clear_buffer_dirty(bh);
                                set_buffer_uptodate(bh);
                                bh->b_end_io = journal_end_buffer_io_sync;
+                               set_buffer_sync_write(bh);
                                submit_bh(WRITE, bh);
                        }
                        cond_resched();





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel