diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-04-13 18:07:37 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-04-13 18:07:37 +0000 |
commit | 7e5aa701e7cae853632ce64b2f699af430b2cd97 (patch) | |
tree | dfd322f5ca4a61caf5445e4592332624cd3ae902 /sys | |
parent | 9bbca33aafa1dce8113739d886a0e1fd347985e7 (diff) |
Remove cluster reading from cd9660_read(); wich doesnt work.
From mickey@; ok thib@,miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 60 |
1 files changed, 21 insertions, 39 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 6433dd131a7..3dd12ea608c 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vnops.c,v 1.39 2007/03/21 17:29:31 thib Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.40 2007/04/13 18:07:36 thib Exp $ */ /* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */ /*- @@ -288,16 +288,6 @@ cd9660_getattr(v) return (0); } -#ifdef DEBUG -extern int doclusterread; -#else -#define doclusterread 1 -#endif - -/* XXX until cluster routines can handle block sizes less than one page */ -#define cd9660_doclusterread \ - (doclusterread && (ISO_DEFAULT_BLOCK_SIZE >= NBPG)) - /* * Vnode op for reading. */ @@ -341,35 +331,27 @@ cd9660_read(v) n = diff; size = blksize(imp, ip, lbn); rablock = lbn + 1; - if (cd9660_doclusterread) { - if (lblktosize(imp, rablock) <= ip->i_size) - error = cluster_read(vp, &ip->i_ci, - (off_t)ip->i_size, lbn, size, NOCRED, &bp); - else - error = bread(vp, lbn, size, NOCRED, &bp); - } else { #define MAX_RA 32 - if (ci->ci_lastr + 1 == lbn) { - struct ra { - daddr64_t blks[MAX_RA]; - int sizes[MAX_RA]; - } *ra; - int i; - - MALLOC(ra, struct ra *, sizeof *ra, - M_TEMP, M_WAITOK); - for (i = 0; i < MAX_RA && - lblktosize(imp, (rablock + i)) < ip->i_size; - i++) { - ra->blks[i] = rablock + i; - ra->sizes[i] = blksize(imp, ip, rablock + i); - } - error = breadn(vp, lbn, size, ra->blks, - ra->sizes, i, NOCRED, &bp); - FREE(ra, M_TEMP); - } else - error = bread(vp, lbn, size, NOCRED, &bp); - } + if (ci->ci_lastr + 1 == lbn) { + struct ra { + daddr64_t blks[MAX_RA]; + int sizes[MAX_RA]; + } *ra; + int i; + + MALLOC(ra, struct ra *, sizeof *ra, + M_TEMP, M_WAITOK); + for (i = 0; i < MAX_RA && + lblktosize(imp, (rablock + i)) < ip->i_size; + i++) { + ra->blks[i] = rablock + i; + ra->sizes[i] = blksize(imp, ip, rablock + i); + } + error = breadn(vp, lbn, size, ra->blks, + ra->sizes, i, NOCRED, &bp); + FREE(ra, M_TEMP); + } else + error = bread(vp, lbn, size, NOCRED, &bp); ci->ci_lastr = lbn; n = min(n, size - bp->b_resid); if (error) { |