Commit 9563b3d8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

xfs: remove iomap_delta

The iomap_delta field in struct xfs_iomap just contains the
difference between the offset passed to xfs_iomap and the
iomap_offset.  Just calculate it in the only caller that cares.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 046f1685
...@@ -1512,9 +1512,11 @@ __xfs_get_blocks( ...@@ -1512,9 +1512,11 @@ __xfs_get_blocks(
} }
if (direct || size > (1 << inode->i_blkbits)) { if (direct || size > (1 << inode->i_blkbits)) {
ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); xfs_off_t iomap_delta = offset - iomap.iomap_offset;
ASSERT(iomap.iomap_bsize - iomap_delta > 0);
offset = min_t(xfs_off_t, offset = min_t(xfs_off_t,
iomap.iomap_bsize - iomap.iomap_delta, size); iomap.iomap_bsize - iomap_delta, size);
bh_result->b_size = (ssize_t)min_t(xfs_off_t, LONG_MAX, offset); bh_result->b_size = (ssize_t)min_t(xfs_off_t, LONG_MAX, offset);
} }
......
...@@ -68,7 +68,6 @@ xfs_imap_to_bmap( ...@@ -68,7 +68,6 @@ xfs_imap_to_bmap(
xfs_fsblock_t start_block; xfs_fsblock_t start_block;
iomapp->iomap_offset = XFS_FSB_TO_B(mp, imap->br_startoff); iomapp->iomap_offset = XFS_FSB_TO_B(mp, imap->br_startoff);
iomapp->iomap_delta = offset - iomapp->iomap_offset;
iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount); iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount);
iomapp->iomap_flags = flags; iomapp->iomap_flags = flags;
......
...@@ -72,7 +72,6 @@ typedef struct xfs_iomap { ...@@ -72,7 +72,6 @@ typedef struct xfs_iomap {
xfs_daddr_t iomap_bn; /* first 512B blk of mapping */ xfs_daddr_t iomap_bn; /* first 512B blk of mapping */
xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_offset; /* offset of mapping, bytes */
xfs_off_t iomap_bsize; /* size of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */
xfs_off_t iomap_delta; /* offset into mapping, bytes */
iomap_flags_t iomap_flags; iomap_flags_t iomap_flags;
} xfs_iomap_t; } xfs_iomap_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment