summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-08-17 23:00:30 +0000
committerphk <phk@FreeBSD.org>2003-08-17 23:00:30 +0000
commitcdcca2ab04b0d94fd9454304ffb1ef3c66c0bbcd (patch)
tree550f50fd783e86d4fc0432ee380e9569d5443264
parente24c6c21c04ba81f74e72a73d8f97f1e1e5e53b2 (diff)
downloadFreeBSD-src-cdcca2ab04b0d94fd9454304ffb1ef3c66c0bbcd.zip
FreeBSD-src-cdcca2ab04b0d94fd9454304ffb1ef3c66c0bbcd.tar.gz
Do not call VOP_BMAP() on our own vnodes.
It is particularly silly when all it does is a minor piece of math.
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c13
-rw-r--r--sys/isofs/cd9660/cd9660_lookup.c13
2 files changed, 6 insertions, 20 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index cc2fa8c..056e893 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -410,12 +410,13 @@ cd9660_blkatoff(vp, offset, res, bpp)
register struct iso_mnt *imp;
struct buf *bp;
daddr_t lbn;
- int bsize, error;
+ int bsize, bshift, error;
ip = VTOI(vp);
imp = ip->i_mnt;
lbn = lblkno(imp, offset);
bsize = blksize(imp, ip, lbn);
+ bshift = imp->im_bshift;
if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
@@ -433,15 +434,7 @@ cd9660_blkatoff(vp, offset, res, bpp)
* reconstituted buffer will have no knowledge of b_blkno.
*/
if (bp->b_blkno == bp->b_lblkno) {
- error = VOP_BMAP(vp, bp->b_lblkno, NULL,
- &bp->b_blkno, NULL, NULL);
- if (error) {
- bp->b_error = error;
- bp->b_ioflags |= BIO_ERROR;
- brelse(bp);
- *bpp = NULL;
- return (error);
- }
+ bp->b_blkno = (ip->iso_start + bp->b_lblkno) << (bshift - DEV_BSHIFT);
}
if (res)
diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c
index cc2fa8c..056e893 100644
--- a/sys/isofs/cd9660/cd9660_lookup.c
+++ b/sys/isofs/cd9660/cd9660_lookup.c
@@ -410,12 +410,13 @@ cd9660_blkatoff(vp, offset, res, bpp)
register struct iso_mnt *imp;
struct buf *bp;
daddr_t lbn;
- int bsize, error;
+ int bsize, bshift, error;
ip = VTOI(vp);
imp = ip->i_mnt;
lbn = lblkno(imp, offset);
bsize = blksize(imp, ip, lbn);
+ bshift = imp->im_bshift;
if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
@@ -433,15 +434,7 @@ cd9660_blkatoff(vp, offset, res, bpp)
* reconstituted buffer will have no knowledge of b_blkno.
*/
if (bp->b_blkno == bp->b_lblkno) {
- error = VOP_BMAP(vp, bp->b_lblkno, NULL,
- &bp->b_blkno, NULL, NULL);
- if (error) {
- bp->b_error = error;
- bp->b_ioflags |= BIO_ERROR;
- brelse(bp);
- *bpp = NULL;
- return (error);
- }
+ bp->b_blkno = (ip->iso_start + bp->b_lblkno) << (bshift - DEV_BSHIFT);
}
if (res)
OpenPOWER on IntegriCloud