提交 26707699 编写于 作者: J Jan Kara 提交者: Linus Torvalds

[PATCH] Change ll_rw_block() calls in JBD

We must be sure that the current data in buffer are sent to disk.  Hence we
have to call ll_rw_block() with SWRITE.
Signed-off-by: NJan Kara <jack@suse.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a7662236
...@@ -204,7 +204,7 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count) ...@@ -204,7 +204,7 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
int i; int i;
spin_unlock(&journal->j_list_lock); spin_unlock(&journal->j_list_lock);
ll_rw_block(WRITE, *batch_count, bhs); ll_rw_block(SWRITE, *batch_count, bhs);
spin_lock(&journal->j_list_lock); spin_lock(&journal->j_list_lock);
for (i = 0; i < *batch_count; i++) { for (i = 0; i < *batch_count; i++) {
struct buffer_head *bh = bhs[i]; struct buffer_head *bh = bhs[i];
......
...@@ -358,7 +358,7 @@ void journal_commit_transaction(journal_t *journal) ...@@ -358,7 +358,7 @@ void journal_commit_transaction(journal_t *journal)
jbd_debug(2, "submit %d writes\n", jbd_debug(2, "submit %d writes\n",
bufs); bufs);
spin_unlock(&journal->j_list_lock); spin_unlock(&journal->j_list_lock);
ll_rw_block(WRITE, bufs, wbuf); ll_rw_block(SWRITE, bufs, wbuf);
journal_brelse_array(wbuf, bufs); journal_brelse_array(wbuf, bufs);
bufs = 0; bufs = 0;
goto write_out_data; goto write_out_data;
...@@ -381,7 +381,7 @@ void journal_commit_transaction(journal_t *journal) ...@@ -381,7 +381,7 @@ void journal_commit_transaction(journal_t *journal)
if (bufs) { if (bufs) {
spin_unlock(&journal->j_list_lock); spin_unlock(&journal->j_list_lock);
ll_rw_block(WRITE, bufs, wbuf); ll_rw_block(SWRITE, bufs, wbuf);
journal_brelse_array(wbuf, bufs); journal_brelse_array(wbuf, bufs);
spin_lock(&journal->j_list_lock); spin_lock(&journal->j_list_lock);
} }
......
...@@ -957,7 +957,7 @@ void journal_update_superblock(journal_t *journal, int wait) ...@@ -957,7 +957,7 @@ void journal_update_superblock(journal_t *journal, int wait)
if (wait) if (wait)
sync_dirty_buffer(bh); sync_dirty_buffer(bh);
else else
ll_rw_block(WRITE, 1, &bh); ll_rw_block(SWRITE, 1, &bh);
out: out:
/* If we have just flushed the log (by marking s_start==0), then /* If we have just flushed the log (by marking s_start==0), then
......
...@@ -614,7 +614,7 @@ static void flush_descriptor(journal_t *journal, ...@@ -614,7 +614,7 @@ static void flush_descriptor(journal_t *journal,
set_buffer_jwrite(bh); set_buffer_jwrite(bh);
BUFFER_TRACE(bh, "write"); BUFFER_TRACE(bh, "write");
set_buffer_dirty(bh); set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh); ll_rw_block(SWRITE, 1, &bh);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册