aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
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 49b5ad22a9d8..fbe5d32f9ef5 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -64,24 +64,15 @@ xfs_imap_to_bmap(
64 int imaps, /* Number of imap entries */ 64 int imaps, /* Number of imap entries */
65 int flags) 65 int flags)
66{ 66{
67 xfs_fsblock_t start_block;
68
69 iomapp->iomap_offset = imap->br_startoff; 67 iomapp->iomap_offset = imap->br_startoff;
70 iomapp->iomap_bsize = imap->br_blockcount; 68 iomapp->iomap_bsize = imap->br_blockcount;
71 iomapp->iomap_flags = flags; 69 iomapp->iomap_flags = flags;
70 iomapp->iomap_bn = imap->br_startblock;
72 71
73 start_block = imap->br_startblock; 72 if (imap->br_startblock != HOLESTARTBLOCK &&
74 if (start_block == HOLESTARTBLOCK) { 73 imap->br_startblock != DELAYSTARTBLOCK &&
75 iomapp->iomap_bn = IOMAP_DADDR_NULL; 74 ISUNWRITTEN(imap))
76 iomapp->iomap_flags |= IOMAP_HOLE; 75 iomapp->iomap_flags |= IOMAP_UNWRITTEN;
77 } else if (start_block == DELAYSTARTBLOCK) {
78 iomapp->iomap_bn = IOMAP_DADDR_NULL;
79 iomapp->iomap_flags |= IOMAP_DELAY;
80 } else {
81 iomapp->iomap_bn = xfs_fsb_to_db(ip, start_block);
82 if (ISUNWRITTEN(imap))
83 iomapp->iomap_flags |= IOMAP_UNWRITTEN;
84 }
85} 76}
86 77
87int 78int