Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196247
b: refs/heads/master
c: 5277970
h: refs/heads/master
i:
  196245: e710eac
  196243: 86d9f09
  196239: da8defa
v: v3
  • Loading branch information
Jan Kara committed May 21, 2010
1 parent c5b198b commit 7451592
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 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: 03f4d804a1b4748885dc4613a4afe10089a731c8
refs/heads/master: 5277970878a32e437b27296e34c592e5d351f11d
20 changes: 9 additions & 11 deletions trunk/fs/ext3/fsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
struct inode *inode = dentry->d_inode;
struct ext3_inode_info *ei = EXT3_I(inode);
journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
int ret = 0;
int ret, needs_barrier = 0;
tid_t commit_tid;

if (inode->i_sb->s_flags & MS_RDONLY)
Expand All @@ -70,28 +70,26 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
* (they were dirtied by commit). But that's OK - the blocks are
* safe in-journal, which is all fsync() needs to ensure.
*/
if (ext3_should_journal_data(inode)) {
ret = ext3_force_commit(inode->i_sb);
goto out;
}
if (ext3_should_journal_data(inode))
return ext3_force_commit(inode->i_sb);

if (datasync)
commit_tid = atomic_read(&ei->i_datasync_tid);
else
commit_tid = atomic_read(&ei->i_sync_tid);

if (log_start_commit(journal, commit_tid)) {
log_wait_commit(journal, commit_tid);
goto out;
}
if (test_opt(inode->i_sb, BARRIER) &&
!journal_trans_will_send_data_barrier(journal, commit_tid))
needs_barrier = 1;
log_start_commit(journal, commit_tid);
ret = log_wait_commit(journal, commit_tid);

/*
* In case we didn't commit a transaction, we have to flush
* disk caches manually so that data really is on persistent
* storage
*/
if (test_opt(inode->i_sb, BARRIER))
if (needs_barrier)
blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
out:
return ret;
}
2 changes: 1 addition & 1 deletion trunk/fs/jbd/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ int journal_trans_will_send_data_barrier(journal_t *journal, tid_t tid)
spin_unlock(&journal->j_state_lock);
return ret;
}
EXPORT_SYMBOL(journal_commit_will_send_barrier);
EXPORT_SYMBOL(journal_trans_will_send_data_barrier);

/*
* Log buffer allocation routines:
Expand Down

0 comments on commit 7451592

Please sign in to comment.