Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166594
b: refs/heads/master
c: 830156c
h: refs/heads/master
v: v3
  • Loading branch information
Frank Mayhar authored and Theodore Ts'o committed Sep 29, 2009
1 parent 52e0bf0 commit 02b991d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 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: f3ce8064b388ccf420012c5a4907aae4f13fe9d0
refs/heads/master: 830156c79b0a99ddf0f62496bcf4de640f9f52cd
37 changes: 16 additions & 21 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4991,8 +4991,7 @@ static int ext4_inode_blocks_set(handle_t *handle,
*/
static int ext4_do_update_inode(handle_t *handle,
struct inode *inode,
struct ext4_iloc *iloc,
int do_sync)
struct ext4_iloc *iloc)
{
struct ext4_inode *raw_inode = ext4_raw_inode(iloc);
struct ext4_inode_info *ei = EXT4_I(inode);
Expand Down Expand Up @@ -5093,22 +5092,10 @@ static int ext4_do_update_inode(handle_t *handle,
raw_inode->i_extra_isize = cpu_to_le16(ei->i_extra_isize);
}

/*
* If we're not using a journal and we were called from
* ext4_write_inode() to sync the inode (making do_sync true),
* we can just use sync_dirty_buffer() directly to do our dirty
* work. Testing s_journal here is a bit redundant but it's
* worth it to avoid potential future trouble.
*/
if (EXT4_SB(inode->i_sb)->s_journal == NULL && do_sync) {
BUFFER_TRACE(bh, "call sync_dirty_buffer");
sync_dirty_buffer(bh);
} else {
BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
rc = ext4_handle_dirty_metadata(handle, inode, bh);
if (!err)
err = rc;
}
BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
rc = ext4_handle_dirty_metadata(handle, inode, bh);
if (!err)
err = rc;
ei->i_state &= ~EXT4_STATE_NEW;

out_brelse:
Expand Down Expand Up @@ -5176,8 +5163,16 @@ int ext4_write_inode(struct inode *inode, int wait)
err = ext4_get_inode_loc(inode, &iloc);
if (err)
return err;
err = ext4_do_update_inode(EXT4_NOJOURNAL_HANDLE,
inode, &iloc, wait);
if (wait)
sync_dirty_buffer(iloc.bh);
if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) {
ext4_error(inode->i_sb, __func__,
"IO error syncing inode, "
"inode=%lu, block=%llu",
inode->i_ino,
(unsigned long long)iloc.bh->b_blocknr);
err = -EIO;
}
}
return err;
}
Expand Down Expand Up @@ -5473,7 +5468,7 @@ int ext4_mark_iloc_dirty(handle_t *handle,
get_bh(iloc->bh);

/* ext4_do_update_inode() does jbd2_journal_dirty_metadata */
err = ext4_do_update_inode(handle, inode, iloc, 0);
err = ext4_do_update_inode(handle, inode, iloc);
put_bh(iloc->bh);
return err;
}
Expand Down

0 comments on commit 02b991d

Please sign in to comment.