mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
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:
parent
9e66317d3c
commit
19fe5f643f
8 changed files with 22 additions and 23 deletions
|
@ -1978,8 +1978,8 @@ iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
|
|||
case IOMAP_MAPPED:
|
||||
if (offset >= i_size_read(inode))
|
||||
set_buffer_new(bh);
|
||||
bh->b_blocknr = (iomap->blkno >> (inode->i_blkbits - 9)) +
|
||||
((offset - iomap->offset) >> inode->i_blkbits);
|
||||
bh->b_blocknr = (iomap->addr + offset - iomap->offset) >>
|
||||
inode->i_blkbits;
|
||||
set_buffer_mapped(bh);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue