iomap: Switch from blkno to disk offset

Replace iomap->blkno, the sector number, with iomap->addr, the disk
offset in bytes.  For invalid disk offsets, use the special value
IOMAP_NULL_ADDR instead of IOMAP_NULL_BLOCK.

This allows to use iomap for mappings which are not block aligned, such
as inline data on ext4.

Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>  # iomap, xfs
Reviewed-by: Jan Kara <[email protected]>
This commit is contained in:
Andreas Gruenbacher 2017-10-01 17:55:54 -04:00 • committed by Theodore Ts'o
commit 19fe5f643f
8 changed files with 22 additions and 23 deletions

View file

@ -938,7 +938,7 @@ EXPORT_SYMBOL_GPL(__dax_zero_page_range);
static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
{
return iomap->blkno + (((pos & PAGE_MASK) - iomap->offset) >> 9);
return (iomap->addr + (pos & PAGE_MASK) - iomap->offset) >> 9;
}
static loff_t