summaryrefslogtreecommitdiffstats
path: root/sys/fs/cd9660/cd9660_bmap.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-02-10 02:22:35 +0000
committerdyson <dyson@FreeBSD.org>1997-02-10 02:22:35 +0000
commit10f666af84d48e89e4e2960415c9b616fce4077f (patch)
tree88a944de263165091f0a18abeedbaaccec532407 /sys/fs/cd9660/cd9660_bmap.c
parent0960d7e91af3428ffba89b42228d82d8afaa0389 (diff)
downloadFreeBSD-src-10f666af84d48e89e4e2960415c9b616fce4077f.zip
FreeBSD-src-10f666af84d48e89e4e2960415c9b616fce4077f.tar.gz
This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
Diffstat (limited to 'sys/fs/cd9660/cd9660_bmap.c')
-rw-r--r--sys/fs/cd9660/cd9660_bmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/cd9660/cd9660_bmap.c b/sys/fs/cd9660/cd9660_bmap.c
index 6fffe7a..71dfb9e 100644
--- a/sys/fs/cd9660/cd9660_bmap.c
+++ b/sys/fs/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;
}
OpenPOWER on IntegriCloud