提交 b3b14aac 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: don't cast inode_log_items to get the log_item

The cast is not type safe, and we can just dereference the first
member instead to start with.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 9ce632a2
...@@ -485,7 +485,7 @@ xfs_lock_inodes( ...@@ -485,7 +485,7 @@ xfs_lock_inodes(
*/ */
if (!try_lock) { if (!try_lock) {
for (j = (i - 1); j >= 0 && !try_lock; j--) { for (j = (i - 1); j >= 0 && !try_lock; j--) {
lp = (xfs_log_item_t *)ips[j]->i_itemp; lp = &ips[j]->i_itemp->ili_item;
if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags))
try_lock++; try_lock++;
} }
...@@ -585,7 +585,7 @@ xfs_lock_two_inodes( ...@@ -585,7 +585,7 @@ xfs_lock_two_inodes(
* the second lock. If we can't get it, we must release the first one * the second lock. If we can't get it, we must release the first one
* and try again. * and try again.
*/ */
lp = (xfs_log_item_t *)ip0->i_itemp; lp = &ip0->i_itemp->ili_item;
if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) { if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) {
if (!xfs_ilock_nowait(ip1, xfs_lock_inumorder(ip1_mode, 1))) { if (!xfs_ilock_nowait(ip1, xfs_lock_inumorder(ip1_mode, 1))) {
xfs_iunlock(ip0, ip0_mode); xfs_iunlock(ip0, ip0_mode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册