diff options
Diffstat (limited to 'sys/isofs/cd9660/cd9660_bmap.c')
-rw-r--r-- | sys/isofs/cd9660/cd9660_bmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/isofs/cd9660/cd9660_bmap.c b/sys/isofs/cd9660/cd9660_bmap.c index 6fffe7a..71dfb9e 100644 --- a/sys/isofs/cd9660/cd9660_bmap.c +++ b/sys/isofs/cd9660/cd9660_bmap.c @@ -67,7 +67,7 @@ cd9660_bmap(ap) { struct iso_node *ip = VTOI(ap->a_vp); daddr_t lblkno = ap->a_bn; - long bsize; + int bshift; /* * Check for underlying vnode requests and ensure that logical @@ -81,8 +81,8 @@ cd9660_bmap(ap) /* * Compute the requested block number */ - bsize = ip->i_mnt->logical_block_size; - *ap->a_bnp = (ip->iso_start + lblkno) * btodb(bsize); + bshift = ip->i_mnt->im_bshift; + *ap->a_bnp = (ip->iso_start + lblkno) << (bshift - DEV_BSHIFT); /* * Determine maximum number of readahead blocks following the @@ -91,11 +91,11 @@ cd9660_bmap(ap) if (ap->a_runp) { int nblk; - nblk = (ip->i_size - (lblkno + 1) * bsize) / bsize; + nblk = (ip->i_size >> bshift) - (lblkno + 1); if (nblk <= 0) *ap->a_runp = 0; - else if (nblk >= MAXBSIZE/bsize) - *ap->a_runp = MAXBSIZE/bsize - 1; + else if (nblk >= (MAXBSIZE >> bshift)) + *ap->a_runp = (MAXBSIZE >> bshift) - 1; else *ap->a_runp = nblk; } |