Wed Jun 19 18:16:53 2013 UTC ()
blkoff() -> cd9660_blkoff()
blksize() -> cd9660_blksize()


(dholland)
diff -r1.24 -r1.25 src/sys/fs/cd9660/cd9660_extern.h
diff -r1.23 -r1.24 src/sys/fs/cd9660/cd9660_lookup.c
diff -r1.76 -r1.77 src/sys/fs/cd9660/cd9660_vfsops.c
diff -r1.43 -r1.44 src/sys/fs/cd9660/cd9660_vnops.c

cvs diff -r1.24 -r1.25 src/sys/fs/cd9660/cd9660_extern.h (expand / switch to unified diff)

--- src/sys/fs/cd9660/cd9660_extern.h 2008/06/28 01:34:05 1.24
+++ src/sys/fs/cd9660/cd9660_extern.h 2013/06/19 18:16:53 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cd9660_extern.h,v 1.24 2008/06/28 01:34:05 rumble Exp $ */ 1/* $NetBSD: cd9660_extern.h,v 1.25 2013/06/19 18:16:53 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1994 4 * Copyright (c) 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley 7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley 9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp). 10 * by Atsushi Murai (amurai@spec.co.jp).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -75,30 +75,30 @@ struct iso_mnt { @@ -75,30 +75,30 @@ struct iso_mnt {
75 int volume_space_size; 75 int volume_space_size;
76 76
77 char root[ISODCL (157, 190)]; 77 char root[ISODCL (157, 190)];
78 int root_extent; 78 int root_extent;
79 int root_size; 79 int root_size;
80 enum ISO_FTYPE iso_ftype; 80 enum ISO_FTYPE iso_ftype;
81 81
82 int rr_skip; 82 int rr_skip;
83 int rr_skip0; 83 int rr_skip0;
84}; 84};
85 85
86#define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data)) 86#define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data))
87 87
88#define blkoff(imp, loc) ((loc) & (imp)->im_bmask) 88#define cd9660_blkoff(imp, loc) ((loc) & (imp)->im_bmask)
89#define lblktosize(imp, blk) ((blk) << (imp)->im_bshift) 89#define lblktosize(imp, blk) ((blk) << (imp)->im_bshift)
90#define lblkno(imp, loc) ((loc) >> (imp)->im_bshift) 90#define lblkno(imp, loc) ((loc) >> (imp)->im_bshift)
91#define blksize(imp, ip, lbn) ((imp)->logical_block_size) 91#define cd9660_blksize(imp, ip, lbn) ((imp)->logical_block_size)
92 92
93#ifdef _KERNEL 93#ifdef _KERNEL
94 94
95VFS_PROTOS(cd9660); 95VFS_PROTOS(cd9660);
96 96
97#include <sys/mallocvar.h> 97#include <sys/mallocvar.h>
98MALLOC_DECLARE(M_ISOFSMNT); 98MALLOC_DECLARE(M_ISOFSMNT);
99 99
100extern struct pool cd9660_node_pool; 100extern struct pool cd9660_node_pool;
101extern int cd9660_utf8_joliet; 101extern int cd9660_utf8_joliet;
102 102
103int cd9660_mountroot(void); 103int cd9660_mountroot(void);
104 104

cvs diff -r1.23 -r1.24 src/sys/fs/cd9660/cd9660_lookup.c (expand / switch to unified diff)

--- src/sys/fs/cd9660/cd9660_lookup.c 2012/12/20 08:03:42 1.23
+++ src/sys/fs/cd9660/cd9660_lookup.c 2013/06/19 18:16:53 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cd9660_lookup.c,v 1.23 2012/12/20 08:03:42 hannken Exp $ */ 1/* $NetBSD: cd9660_lookup.c,v 1.24 2013/06/19 18:16:53 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1989, 1993, 1994 4 * Copyright (c) 1989, 1993, 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley 7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley 9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp). 10 * by Atsushi Murai (amurai@spec.co.jp).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 36 * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
37 * 37 *
38 * @(#)cd9660_lookup.c 8.5 (Berkeley) 5/27/95 38 * @(#)cd9660_lookup.c 8.5 (Berkeley) 5/27/95
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.23 2012/12/20 08:03:42 hannken Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.24 2013/06/19 18:16:53 dholland Exp $");
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/namei.h> 45#include <sys/namei.h>
46#include <sys/buf.h> 46#include <sys/buf.h>
47#include <sys/file.h> 47#include <sys/file.h>
48#include <sys/vnode.h> 48#include <sys/vnode.h>
49#include <sys/mount.h> 49#include <sys/mount.h>
50#include <sys/systm.h> 50#include <sys/systm.h>
51#include <sys/kauth.h> 51#include <sys/kauth.h>
52 52
53#include <fs/cd9660/iso.h> 53#include <fs/cd9660/iso.h>
54#include <fs/cd9660/cd9660_extern.h> 54#include <fs/cd9660/cd9660_extern.h>
55#include <fs/cd9660/cd9660_node.h> 55#include <fs/cd9660/cd9660_node.h>
@@ -412,24 +412,24 @@ found: @@ -412,24 +412,24 @@ found:
412 */ 412 */
413int 413int
414cd9660_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp) 414cd9660_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp)
415{ 415{
416 struct iso_node *ip; 416 struct iso_node *ip;
417 struct iso_mnt *imp; 417 struct iso_mnt *imp;
418 struct buf *bp; 418 struct buf *bp;
419 daddr_t lbn; 419 daddr_t lbn;
420 int bsize, error; 420 int bsize, error;
421 421
422 ip = VTOI(vp); 422 ip = VTOI(vp);
423 imp = ip->i_mnt; 423 imp = ip->i_mnt;
424 lbn = lblkno(imp, offset); 424 lbn = lblkno(imp, offset);
425 bsize = blksize(imp, ip, lbn); 425 bsize = cd9660_blksize(imp, ip, lbn);
426 426
427 if ((error = bread(vp, lbn, bsize, NOCRED, 0, &bp)) != 0) { 427 if ((error = bread(vp, lbn, bsize, NOCRED, 0, &bp)) != 0) {
428 *bpp = NULL; 428 *bpp = NULL;
429 return (error); 429 return (error);
430 } 430 }
431 if (res) 431 if (res)
432 *res = (char *)bp->b_data + blkoff(imp, offset); 432 *res = (char *)bp->b_data + cd9660_blkoff(imp, offset);
433 *bpp = bp; 433 *bpp = bp;
434 return (0); 434 return (0);
435} 435}

cvs diff -r1.76 -r1.77 src/sys/fs/cd9660/cd9660_vfsops.c (expand / switch to unified diff)

--- src/sys/fs/cd9660/cd9660_vfsops.c 2012/12/20 08:03:42 1.76
+++ src/sys/fs/cd9660/cd9660_vfsops.c 2013/06/19 18:16:53 1.77
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cd9660_vfsops.c,v 1.76 2012/12/20 08:03:42 hannken Exp $ */ 1/* $NetBSD: cd9660_vfsops.c,v 1.77 2013/06/19 18:16:53 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1994 4 * Copyright (c) 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley 7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley 9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp). 10 * by Atsushi Murai (amurai@spec.co.jp).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 36 * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.76 2012/12/20 08:03:42 hannken Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.77 2013/06/19 18:16:53 dholland Exp $");
41 41
42#if defined(_KERNEL_OPT) 42#if defined(_KERNEL_OPT)
43#include "opt_compat_netbsd.h" 43#include "opt_compat_netbsd.h"
44#endif 44#endif
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/sysctl.h> 47#include <sys/sysctl.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/namei.h> 49#include <sys/namei.h>
50#include <sys/proc.h> 50#include <sys/proc.h>
51#include <sys/kernel.h> 51#include <sys/kernel.h>
52#include <sys/vnode.h> 52#include <sys/vnode.h>
53#include <miscfs/genfs/genfs.h> 53#include <miscfs/genfs/genfs.h>
@@ -756,27 +756,27 @@ cd9660_vget_internal(struct mount *mp, i @@ -756,27 +756,27 @@ cd9660_vget_internal(struct mount *mp, i
756 cd9660_ihashins(ip); 756 cd9660_ihashins(ip);
757 mutex_exit(&cd9660_hashlock); 757 mutex_exit(&cd9660_hashlock);
758 758
759 if (isodir == 0) { 759 if (isodir == 0) {
760 int lbn, off; 760 int lbn, off;
761 761
762 lbn = lblkno(imp, ino); 762 lbn = lblkno(imp, ino);
763 if (lbn >= imp->volume_space_size) { 763 if (lbn >= imp->volume_space_size) {
764 vput(vp); 764 vput(vp);
765 printf("fhtovp: lbn exceed volume space %d\n", lbn); 765 printf("fhtovp: lbn exceed volume space %d\n", lbn);
766 return (ESTALE); 766 return (ESTALE);
767 } 767 }
768 768
769 off = blkoff(imp, ino); 769 off = cd9660_blkoff(imp, ino);
770 if (off + ISO_DIRECTORY_RECORD_SIZE > imp->logical_block_size) { 770 if (off + ISO_DIRECTORY_RECORD_SIZE > imp->logical_block_size) {
771 vput(vp); 771 vput(vp);
772 printf("fhtovp: crosses block boundary %d\n", 772 printf("fhtovp: crosses block boundary %d\n",
773 off + ISO_DIRECTORY_RECORD_SIZE); 773 off + ISO_DIRECTORY_RECORD_SIZE);
774 return (ESTALE); 774 return (ESTALE);
775 } 775 }
776 776
777 error = bread(imp->im_devvp, 777 error = bread(imp->im_devvp,
778 lbn << (imp->im_bshift - DEV_BSHIFT), 778 lbn << (imp->im_bshift - DEV_BSHIFT),
779 imp->logical_block_size, NOCRED, 0, &bp); 779 imp->logical_block_size, NOCRED, 0, &bp);
780 if (error) { 780 if (error) {
781 vput(vp); 781 vput(vp);
782 printf("fhtovp: bread error %d\n",error); 782 printf("fhtovp: bread error %d\n",error);

cvs diff -r1.43 -r1.44 src/sys/fs/cd9660/cd9660_vnops.c (expand / switch to unified diff)

--- src/sys/fs/cd9660/cd9660_vnops.c 2013/03/18 19:35:35 1.43
+++ src/sys/fs/cd9660/cd9660_vnops.c 2013/06/19 18:16:53 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cd9660_vnops.c,v 1.43 2013/03/18 19:35:35 plunky Exp $ */ 1/* $NetBSD: cd9660_vnops.c,v 1.44 2013/06/19 18:16:53 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1994 4 * Copyright (c) 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley 7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley 9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp). 10 * by Atsushi Murai (amurai@spec.co.jp).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)cd9660_vnops.c 8.15 (Berkeley) 5/27/95 36 * @(#)cd9660_vnops.c 8.15 (Berkeley) 5/27/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.43 2013/03/18 19:35:35 plunky Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.44 2013/06/19 18:16:53 dholland Exp $");
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/namei.h> 44#include <sys/namei.h>
45#include <sys/resourcevar.h> 45#include <sys/resourcevar.h>
46#include <sys/kernel.h> 46#include <sys/kernel.h>
47#include <sys/file.h> 47#include <sys/file.h>
48#include <sys/stat.h> 48#include <sys/stat.h>
49#include <sys/buf.h> 49#include <sys/buf.h>
50#include <sys/proc.h> 50#include <sys/proc.h>
51#include <sys/mount.h> 51#include <sys/mount.h>
52#include <sys/vnode.h> 52#include <sys/vnode.h>
53#include <sys/malloc.h> 53#include <sys/malloc.h>
@@ -240,37 +240,37 @@ cd9660_read(void *v) @@ -240,37 +240,37 @@ cd9660_read(void *v)
240 240
241 if (bytelen == 0) 241 if (bytelen == 0)
242 break; 242 break;
243 error = ubc_uiomove(&vp->v_uobj, uio, bytelen, advice, 243 error = ubc_uiomove(&vp->v_uobj, uio, bytelen, advice,
244 UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp)); 244 UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
245 if (error) 245 if (error)
246 break; 246 break;
247 } 247 }
248 goto out; 248 goto out;
249 } 249 }
250 250
251 do { 251 do {
252 lbn = lblkno(imp, uio->uio_offset); 252 lbn = lblkno(imp, uio->uio_offset);
253 on = blkoff(imp, uio->uio_offset); 253 on = cd9660_blkoff(imp, uio->uio_offset);
254 n = MIN(imp->logical_block_size - on, uio->uio_resid); 254 n = MIN(imp->logical_block_size - on, uio->uio_resid);
255 diff = (off_t)ip->i_size - uio->uio_offset; 255 diff = (off_t)ip->i_size - uio->uio_offset;
256 if (diff <= 0) 256 if (diff <= 0)
257 return (0); 257 return (0);
258 if (diff < n) 258 if (diff < n)
259 n = diff; 259 n = diff;
260 size = blksize(imp, ip, lbn); 260 size = cd9660_blksize(imp, ip, lbn);
261 rablock = lbn + 1; 261 rablock = lbn + 1;
262 if (lblktosize(imp, rablock) < ip->i_size) { 262 if (lblktosize(imp, rablock) < ip->i_size) {
263 rasize = blksize(imp, ip, rablock); 263 rasize = cd9660_blksize(imp, ip, rablock);
264 error = breadn(vp, lbn, size, &rablock, 264 error = breadn(vp, lbn, size, &rablock,
265 &rasize, 1, NOCRED, 0, &bp); 265 &rasize, 1, NOCRED, 0, &bp);
266 } else { 266 } else {
267 error = bread(vp, lbn, size, NOCRED, 0, &bp); 267 error = bread(vp, lbn, size, NOCRED, 0, &bp);
268 } 268 }
269 if (error) { 269 if (error) {
270 return (error); 270 return (error);
271 } 271 }
272 n = MIN(n, size - bp->b_resid); 272 n = MIN(n, size - bp->b_resid);
273 273
274 error = uiomove((char *)bp->b_data + on, (int)n, uio); 274 error = uiomove((char *)bp->b_data + on, (int)n, uio);
275 brelse(bp, 0); 275 brelse(bp, 0);
276 } while (error == 0 && uio->uio_resid > 0 && n != 0); 276 } while (error == 0 && uio->uio_resid > 0 && n != 0);