diff options
author | Brian Foster <bfoster@redhat.com> | 2013-09-20 11:06:09 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-10-08 15:53:02 -0400 |
commit | 36b21dde6e899d2f25077b7c239d2d6bcff17d73 (patch) | |
tree | 34470b5c788b4db47002d891aa7f8d065aabd3df /fs/xfs/xfs_inode.c | |
parent | 2900a579abcea13e4e77c40f89eb16eeecb5508e (diff) |
xfs: push down inactive transaction mgmt for remote symlinks
Push down the transaction management for remote symlinks from
xfs_inactive() down to xfs_inactive_symlink_rmt(). The latter is
cleaned up to avoid transaction management intended for the
calling context (i.e., trans duplication, reservation, item
attachment).
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5ac716b2df22..c26990b50941 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1724,9 +1724,14 @@ xfs_inactive( | |||
1724 | if (error) | 1724 | if (error) |
1725 | return VN_INACTIVE_CACHE; | 1725 | return VN_INACTIVE_CACHE; |
1726 | 1726 | ||
1727 | if (S_ISLNK(ip->i_d.di_mode)) { | ||
1728 | error = xfs_inactive_symlink(ip); | ||
1729 | if (error) | ||
1730 | goto out; | ||
1731 | } | ||
1732 | |||
1727 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); | 1733 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); |
1728 | resp = (truncate || S_ISLNK(ip->i_d.di_mode)) ? | 1734 | resp = truncate ? &M_RES(mp)->tr_itruncate : &M_RES(mp)->tr_ifree; |
1729 | &M_RES(mp)->tr_itruncate : &M_RES(mp)->tr_ifree; | ||
1730 | 1735 | ||
1731 | error = xfs_trans_reserve(tp, resp, 0, 0); | 1736 | error = xfs_trans_reserve(tp, resp, 0, 0); |
1732 | if (error) { | 1737 | if (error) { |
@@ -1738,11 +1743,7 @@ xfs_inactive( | |||
1738 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 1743 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
1739 | xfs_trans_ijoin(tp, ip, 0); | 1744 | xfs_trans_ijoin(tp, ip, 0); |
1740 | 1745 | ||
1741 | if (S_ISLNK(ip->i_d.di_mode)) { | 1746 | if (truncate) { |
1742 | error = xfs_inactive_symlink(ip, &tp); | ||
1743 | if (error) | ||
1744 | goto out_cancel; | ||
1745 | } else if (truncate) { | ||
1746 | ip->i_d.di_size = 0; | 1747 | ip->i_d.di_size = 0; |
1747 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 1748 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
1748 | 1749 | ||