Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263618
b: refs/heads/master
c: 58d84c4
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Sep 1, 2011
1 parent 1370b95 commit 63ce1c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 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: 866e4ed77448a0c311e1b055eb72ea05423fd799
refs/heads/master: 58d84c4ee0389ddeb86238d5d8359a982c9f7a5b
34 changes: 9 additions & 25 deletions trunk/fs/xfs/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,33 +879,17 @@ xfs_log_inode(
struct xfs_trans *tp;
int error;

xfs_iunlock(ip, XFS_ILOCK_SHARED);
tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);

if (error) {
xfs_trans_cancel(tp, 0);
/* we need to return with the lock hold shared */
xfs_ilock(ip, XFS_ILOCK_SHARED);
return error;
}

xfs_ilock(ip, XFS_ILOCK_EXCL);

/*
* Note - it's possible that we might have pushed ourselves out of the
* way during trans_reserve which would flush the inode. But there's
* no guarantee that the inode buffer has actually gone out yet (it's
* delwri). Plus the buffer could be pinned anyway if it's part of
* an inode in another recent transaction. So we play it safe and
* fire off the transaction anyway.
*/
xfs_trans_ijoin(tp, ip);
xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = xfs_trans_commit(tp, 0);
xfs_ilock_demote(ip, XFS_ILOCK_EXCL);

return error;
return xfs_trans_commit(tp, 0);
}

STATIC int
Expand All @@ -920,7 +904,9 @@ xfs_fs_write_inode(
trace_xfs_write_inode(ip);

if (XFS_FORCED_SHUTDOWN(mp))
return XFS_ERROR(EIO);
return -XFS_ERROR(EIO);
if (!ip->i_update_core)
return 0;

if (wbc->sync_mode == WB_SYNC_ALL) {
/*
Expand All @@ -931,12 +917,10 @@ xfs_fs_write_inode(
* of synchronous log foces dramatically.
*/
xfs_ioend_wait(ip);
xfs_ilock(ip, XFS_ILOCK_SHARED);
if (ip->i_update_core) {
error = xfs_log_inode(ip);
if (error)
goto out_unlock;
}
error = xfs_log_inode(ip);
if (error)
goto out;
return 0;
} else {
/*
* We make this non-blocking if the inode is contended, return
Expand Down

0 comments on commit 63ce1c2

Please sign in to comment.