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>
Esse commit está contido em:

commit de
Theodore Ts'o

pai
9e66317d3c
commit
19fe5f643f
@@ -3472,7 +3472,7 @@ retry:
|
||||
|
||||
if (ret == 0) {
|
||||
iomap->type = IOMAP_HOLE;
|
||||
iomap->blkno = IOMAP_NULL_BLOCK;
|
||||
iomap->addr = IOMAP_NULL_ADDR;
|
||||
iomap->length = (u64)map.m_len << blkbits;
|
||||
} else {
|
||||
if (map.m_flags & EXT4_MAP_MAPPED) {
|
||||
@@ -3483,7 +3483,7 @@ retry:
|
||||
WARN_ON_ONCE(1);
|
||||
return -EIO;
|
||||
}
|
||||
iomap->blkno = (sector_t)map.m_pblk << (blkbits - 9);
|
||||
iomap->addr = (u64)map.m_pblk << blkbits;
|
||||
iomap->length = (u64)map.m_len << blkbits;
|
||||
}
|
||||
|
||||
|
Referência em uma nova issue
Block a user