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 <agruenba@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> # iomap, xfs Reviewed-by: Jan Kara <jack@suse.cz>
This commit is contained in:

committed by
Theodore Ts'o

parent
9e66317d3c
commit
19fe5f643f
@@ -54,13 +54,13 @@ xfs_bmbt_to_iomap(
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
|
||||
if (imap->br_startblock == HOLESTARTBLOCK) {
|
||||
iomap->blkno = IOMAP_NULL_BLOCK;
|
||||
iomap->addr = IOMAP_NULL_ADDR;
|
||||
iomap->type = IOMAP_HOLE;
|
||||
} else if (imap->br_startblock == DELAYSTARTBLOCK) {
|
||||
iomap->blkno = IOMAP_NULL_BLOCK;
|
||||
iomap->addr = IOMAP_NULL_ADDR;
|
||||
iomap->type = IOMAP_DELALLOC;
|
||||
} else {
|
||||
iomap->blkno = xfs_fsb_to_db(ip, imap->br_startblock);
|
||||
iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock));
|
||||
if (imap->br_state == XFS_EXT_UNWRITTEN)
|
||||
iomap->type = IOMAP_UNWRITTEN;
|
||||
else
|
||||
|
Reference in New Issue
Block a user