mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
xfs: remove block number from inode lookup code
The block number comes from bulkstat based inode lookups to shortcut the mapping calculations. We ar enot able to trust anything from bulkstat, so drop the block number as well so that the correct lookups and mappings are always done. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
1920779e67
commit
7b6259e7a8
15 changed files with 26 additions and 59 deletions
|
@ -1354,22 +1354,6 @@ xfs_imap(
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we get a block number passed we can use it to
|
||||
* find the buffer easily.
|
||||
*/
|
||||
if (imap->im_blkno) {
|
||||
offset = XFS_INO_TO_OFFSET(mp, ino);
|
||||
ASSERT(offset < mp->m_sb.sb_inopblock);
|
||||
|
||||
cluster_agbno = xfs_daddr_to_agbno(mp, imap->im_blkno);
|
||||
offset += (agbno - cluster_agbno) * mp->m_sb.sb_inopblock;
|
||||
|
||||
imap->im_len = XFS_FSB_TO_BB(mp, blks_per_cluster);
|
||||
imap->im_boffset = (ushort)(offset << mp->m_sb.sb_inodelog);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the inode chunks are aligned then use simple maths to
|
||||
* find the location. Otherwise we have to do a btree
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue