Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19805
b: refs/heads/master
c: fe1dcbc
h: refs/heads/master
i:
  19803: e08f858
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 5, 2006
1 parent 7343cf8 commit c6b2e10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 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: bc5e483da61eb5ab8d24b4a919fb512e5886d02c
refs/heads/master: fe1dcbc4f311c2e6c23b33c0fa8572461618ab3e
10 changes: 9 additions & 1 deletion trunk/fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ int journal_stop(handle_t *handle)
transaction_t *transaction = handle->h_transaction;
journal_t *journal = transaction->t_journal;
int old_handle_count, err;
pid_t pid;

J_ASSERT(transaction->t_updates > 0);
J_ASSERT(journal_current_handle() == handle);
Expand All @@ -1333,8 +1334,15 @@ int journal_stop(handle_t *handle)
* It doesn't cost much - we're about to run a commit and sleep
* on IO anyway. Speeds up many-threaded, many-dir operations
* by 30x or more...
*
* But don't do this if this process was the most recent one to
* perform a synchronous write. We do this to detect the case where a
* single process is doing a stream of sync writes. No point in waiting
* for joiners in that case.
*/
if (handle->h_sync) {
pid = current->pid;
if (handle->h_sync && journal->j_last_sync_writer != pid) {
journal->j_last_sync_writer = pid;
do {
old_handle_count = transaction->t_handle_count;
schedule_timeout_uninterruptible(1);
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/jbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define jfs_debug jbd_debug
#else

#include <linux/types.h>
#include <linux/buffer_head.h>
#include <linux/journal-head.h>
#include <linux/stddef.h>
Expand Down Expand Up @@ -618,6 +619,7 @@ struct transaction_s
* @j_wbuf: array of buffer_heads for journal_commit_transaction
* @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
* number that will fit in j_blocksize
* @j_last_sync_writer: most recent pid which did a synchronous write
* @j_private: An opaque pointer to fs-private information.
*/

Expand Down Expand Up @@ -807,6 +809,8 @@ struct journal_s
struct buffer_head **j_wbuf;
int j_wbufsize;

pid_t j_last_sync_writer;

/*
* An opaque pointer to fs-private information. ext3 puts its
* superblock pointer here
Expand Down

0 comments on commit c6b2e10

Please sign in to comment.