summaryrefslogtreecommitdiffstats
path: root/fs/ext3/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 11:10:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 11:10:33 -0700
commit20bec8ab1458c24bed0d5492ee15d87807fc415a (patch)
treee5f910947dbe314b96a591e41e2cfb2d3322caad /fs/ext3/namei.c
parent18b34b9546dc192d978dda940673f40928d2e36e (diff)
parente7c8f5079ed9ec9e6eb1abe3defc5fb4ebfdf1cb (diff)
downloadblackbird-op-linux-20bec8ab1458c24bed0d5492ee15d87807fc415a.tar.gz
blackbird-op-linux-20bec8ab1458c24bed0d5492ee15d87807fc415a.zip
Merge branch 'ext3-latency-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'ext3-latency-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext3: Add replace-on-rename hueristics for data=writeback mode ext3: Add replace-on-truncate hueristics for data=writeback mode ext3: Use WRITE_SYNC for commits which are caused by fsync() block_write_full_page: Use synchronous writes for WBC_SYNC_ALL writebacks
Diffstat (limited to 'fs/ext3/namei.c')
-rw-r--r--fs/ext3/namei.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 6ddaa0a42b24..6ff7b9730234 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -2274,7 +2274,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
struct inode * old_inode, * new_inode;
struct buffer_head * old_bh, * new_bh, * dir_bh;
struct ext3_dir_entry_2 * old_de, * new_de;
- int retval;
+ int retval, flush_file = 0;
old_bh = new_bh = dir_bh = NULL;
@@ -2410,6 +2410,8 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
ext3_mark_inode_dirty(handle, new_inode);
if (!new_inode->i_nlink)
ext3_orphan_add(handle, new_inode);
+ if (ext3_should_writeback_data(new_inode))
+ flush_file = 1;
}
retval = 0;
@@ -2418,6 +2420,8 @@ end_rename:
brelse (old_bh);
brelse (new_bh);
ext3_journal_stop(handle);
+ if (retval == 0 && flush_file)
+ filemap_flush(old_inode->i_mapping);
return retval;
}
OpenPOWER on IntegriCloud