Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251746
b: refs/heads/master
c: 81be12c
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Theodore Ts'o committed May 24, 2011
1 parent 3dd2332 commit 4bc99ac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b221349fa8b45d13c3650089f0514df7d1eb36c3
refs/heads/master: 81be12c8179c1c397d3f179cdd9b3f7146cf47f1
3 changes: 1 addition & 2 deletions trunk/fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ static int journal_submit_data_buffers(journal_t *journal,
ret = err;
spin_lock(&journal->j_list_lock);
J_ASSERT(jinode->i_transaction == commit_transaction);
commit_transaction->t_flushed_data_blocks = 1;
clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags);
smp_mb__after_clear_bit();
wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);
Expand Down Expand Up @@ -683,7 +682,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
* then we must flush the file system device before we issue
* the commit record
*/
if (commit_transaction->t_flushed_data_blocks &&
if (commit_transaction->t_need_data_flush &&
(journal->j_fs_dev != journal->j_dev) &&
(journal->j_flags & JBD2_BARRIER))
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
Expand Down
7 changes: 7 additions & 0 deletions trunk/fs/jbd2/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2147,6 +2147,13 @@ int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode)
jinode->i_next_transaction == transaction)
goto done;

/*
* We only ever set this variable to 1 so the test is safe. Since
* t_need_data_flush is likely to be set, we do the test to save some
* cacheline bouncing
*/
if (!transaction->t_need_data_flush)
transaction->t_need_data_flush = 1;
/* On some different transaction's list - should be
* the committing one */
if (jinode->i_transaction) {
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/jbd2.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ struct transaction_s
* waiting for it to finish.
*/
unsigned int t_synchronous_commit:1;
unsigned int t_flushed_data_blocks:1;

/* Disk flush needs to be sent to fs partition [no locking] */
int t_need_data_flush;

/*
* For use by the filesystem to store fs-specific data
Expand Down

0 comments on commit 4bc99ac

Please sign in to comment.