diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-28 22:27:33 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-06-28 22:27:33 -0400 |
commit | b3b14aacc6765eb908f13d0422d9b2d0cd822e14 (patch) | |
tree | ecc02eb59f63ba49592e5ca48fb4855bfc1c4919 | |
parent | 9ce632a28a41bd9aeeaa3913d95b23648a82c2ee (diff) |
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/xfs_inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 48756e0219fa..3b745a33859b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -485,7 +485,7 @@ again: | |||
485 | */ | 485 | */ |
486 | if (!try_lock) { | 486 | if (!try_lock) { |
487 | for (j = (i - 1); j >= 0 && !try_lock; j--) { | 487 | for (j = (i - 1); j >= 0 && !try_lock; j--) { |
488 | lp = (xfs_log_item_t *)ips[j]->i_itemp; | 488 | lp = &ips[j]->i_itemp->ili_item; |
489 | if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) | 489 | if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) |
490 | try_lock++; | 490 | try_lock++; |
491 | } | 491 | } |
@@ -585,7 +585,7 @@ xfs_lock_two_inodes( | |||
585 | * the second lock. If we can't get it, we must release the first one | 585 | * the second lock. If we can't get it, we must release the first one |
586 | * and try again. | 586 | * and try again. |
587 | */ | 587 | */ |
588 | lp = (xfs_log_item_t *)ip0->i_itemp; | 588 | lp = &ip0->i_itemp->ili_item; |
589 | if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) { | 589 | if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) { |
590 | if (!xfs_ilock_nowait(ip1, xfs_lock_inumorder(ip1_mode, 1))) { | 590 | if (!xfs_ilock_nowait(ip1, xfs_lock_inumorder(ip1_mode, 1))) { |
591 | xfs_iunlock(ip0, ip0_mode); | 591 | xfs_iunlock(ip0, ip0_mode); |