diff options
author | Christoph Hellwig <hch@lst.de> | 2008-12-03 06:20:35 -0500 |
---|---|---|
committer | Niv Sardi <xaiki@sgi.com> | 2008-12-03 23:39:23 -0500 |
commit | 070c4616ec62fc207e2aeef9d0f28af294c651d0 (patch) | |
tree | 9d74cca3eb75c65d2cbb2bcaa320b8c8f408404c /fs/xfs | |
parent | b56757becf8bc62292263a24a23cf55edb4be55f (diff) |
use xfs_trans_ijoin in xfs_trans_iget
Use xfs_trans_ijoin in xfs_trans_iget in case we need to join an inode into
a transaction instead of opencoding it. Based on a discussion with and an
incomplete patch from Niv Sardi.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_trans_inode.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 2a1c0f071f91..23d276af2e0c 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c | |||
@@ -85,7 +85,6 @@ xfs_trans_iget( | |||
85 | { | 85 | { |
86 | int error; | 86 | int error; |
87 | xfs_inode_t *ip; | 87 | xfs_inode_t *ip; |
88 | xfs_inode_log_item_t *iip; | ||
89 | 88 | ||
90 | /* | 89 | /* |
91 | * If the transaction pointer is NULL, just call the normal | 90 | * If the transaction pointer is NULL, just call the normal |
@@ -138,34 +137,7 @@ xfs_trans_iget( | |||
138 | } | 137 | } |
139 | ASSERT(ip != NULL); | 138 | ASSERT(ip != NULL); |
140 | 139 | ||
141 | /* | 140 | xfs_trans_ijoin(tp, ip, lock_flags); |
142 | * Get a log_item_desc to point at the new item. | ||
143 | */ | ||
144 | if (ip->i_itemp == NULL) | ||
145 | xfs_inode_item_init(ip, mp); | ||
146 | iip = ip->i_itemp; | ||
147 | (void) xfs_trans_add_item(tp, (xfs_log_item_t *)(iip)); | ||
148 | |||
149 | xfs_trans_inode_broot_debug(ip); | ||
150 | |||
151 | /* | ||
152 | * If the IO lock has been acquired, mark that in | ||
153 | * the inode log item so we'll know to unlock it | ||
154 | * when the transaction commits. | ||
155 | */ | ||
156 | ASSERT(iip->ili_flags == 0); | ||
157 | if (lock_flags & XFS_IOLOCK_EXCL) { | ||
158 | iip->ili_flags |= XFS_ILI_IOLOCKED_EXCL; | ||
159 | } else if (lock_flags & XFS_IOLOCK_SHARED) { | ||
160 | iip->ili_flags |= XFS_ILI_IOLOCKED_SHARED; | ||
161 | } | ||
162 | |||
163 | /* | ||
164 | * Initialize i_transp so we can find it with xfs_inode_incore() | ||
165 | * above. | ||
166 | */ | ||
167 | ip->i_transp = tp; | ||
168 | |||
169 | *ipp = ip; | 141 | *ipp = ip; |
170 | return 0; | 142 | return 0; |
171 | } | 143 | } |