xfs: clean up dqblk extraction
authorDarrick J. Wong <djwong@kernel.org>
Thu, 8 Feb 2024 23:20:51 +0000 (15:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2024 18:10:46 +0000 (19:10 +0100)
commitd744e578802a8d182b77d85148a284036340b6ad
treed296866a7fa8ebd4d9b787f886ba4fe9bcbfe1c6
parentb28b234276a816bcf5e00af29b02e2c843f52ddb
xfs: clean up dqblk extraction

commit ed17f7da5f0c8b65b7b5f7c98beb0aadbc0546ee upstream.

Since the introduction of xfs_dqblk in V5, xfs really ought to find the
dqblk pointer from the dquot buffer, then compute the xfs_disk_dquot
pointer from the dqblk pointer.  Fix the open-coded xfs_buf_offset calls
and do the type checking in the correct order.

Note that this has made no practical difference since the start of the
xfs_disk_dquot is coincident with the start of the xfs_dqblk.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot_item_recover.c