aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-04-28 12:28:55 +0000
committerAlex Elder <aelder@sgi.com>2010-05-19 09:58:17 -0500
commite513182d4d7ec8f1870ae368c549ef2838e2c105 (patch)
tree1dc543b7f798c4826684bf2a0a5d83bd363f246f /fs/xfs/xfs_iomap.c
parent8699bb0a480193e62d5ccb9c86e2c26b407090a8 (diff)
downloadkernel_samsung_smdk4412-e513182d4d7ec8f1870ae368c549ef2838e2c105.zip
kernel_samsung_smdk4412-e513182d4d7ec8f1870ae368c549ef2838e2c105.tar.gz
kernel_samsung_smdk4412-e513182d4d7ec8f1870ae368c549ef2838e2c105.tar.bz2
xfs: report iomap_bn in block base
Report the iomap_bn field of struct xfs_iomap in terms of filesystem blocks instead of in terms of bytes. Shift the byte conversions into the caller, and replace the IOMAP_DELAY and IOMAP_HOLE flag checks with checks for HOLESTARTBLOCK and DELAYSTARTBLOCK. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 49b5ad2..fbe5d32 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -64,24 +64,15 @@ xfs_imap_to_bmap(
int imaps, /* Number of imap entries */
int flags)
{
- xfs_fsblock_t start_block;
-
iomapp->iomap_offset = imap->br_startoff;
iomapp->iomap_bsize = imap->br_blockcount;
iomapp->iomap_flags = flags;
+ iomapp->iomap_bn = imap->br_startblock;
- start_block = imap->br_startblock;
- if (start_block == HOLESTARTBLOCK) {
- iomapp->iomap_bn = IOMAP_DADDR_NULL;
- iomapp->iomap_flags |= IOMAP_HOLE;
- } else if (start_block == DELAYSTARTBLOCK) {
- iomapp->iomap_bn = IOMAP_DADDR_NULL;
- iomapp->iomap_flags |= IOMAP_DELAY;
- } else {
- iomapp->iomap_bn = xfs_fsb_to_db(ip, start_block);
- if (ISUNWRITTEN(imap))
- iomapp->iomap_flags |= IOMAP_UNWRITTEN;
- }
+ if (imap->br_startblock != HOLESTARTBLOCK &&
+ imap->br_startblock != DELAYSTARTBLOCK &&
+ ISUNWRITTEN(imap))
+ iomapp->iomap_flags |= IOMAP_UNWRITTEN;
}
int