ffs_subr.c (1817) | ffs_subr.c (3487) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_subr.c 8.2 (Berkeley) 9/21/93 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_subr.c 8.2 (Berkeley) 9/21/93 |
34 * $Id$ | 34 * $Id: ffs_subr.c,v 1.2 1994/08/02 07:54:22 davidg Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <ufs/ffs/fs.h> 39 40#ifdef KERNEL 41#include <sys/systm.h> 42#include <sys/vnode.h> --- 23 unchanged lines hidden (view full) --- 66 int bsize, error; 67 68 ip = VTOI(ap->a_vp); 69 fs = ip->i_fs; 70 lbn = lblkno(fs, ap->a_offset); 71 bsize = blksize(fs, ip, lbn); 72 73 *ap->a_bpp = NULL; | 35 */ 36 37#include <sys/param.h> 38#include <ufs/ffs/fs.h> 39 40#ifdef KERNEL 41#include <sys/systm.h> 42#include <sys/vnode.h> --- 23 unchanged lines hidden (view full) --- 66 int bsize, error; 67 68 ip = VTOI(ap->a_vp); 69 fs = ip->i_fs; 70 lbn = lblkno(fs, ap->a_offset); 71 bsize = blksize(fs, ip, lbn); 72 73 *ap->a_bpp = NULL; |
74 if (error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) { | 74 error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp); 75 if (error) { |
75 brelse(bp); 76 return (error); 77 } 78 if (ap->a_res) 79 *ap->a_res = (char *)bp->b_data + blkoff(fs, ap->a_offset); 80 *ap->a_bpp = bp; 81 return (0); 82} --- 55 unchanged lines hidden (view full) --- 138 continue; 139 if (vp != ip->i_devvp) 140 continue; 141 /* look for overlap */ 142 if (ep->b_bcount == 0 || ep->b_blkno > last || 143 ep->b_blkno + btodb(ep->b_bcount) <= start) 144 continue; 145 vprint("Disk overlap", vp); | 76 brelse(bp); 77 return (error); 78 } 79 if (ap->a_res) 80 *ap->a_res = (char *)bp->b_data + blkoff(fs, ap->a_offset); 81 *ap->a_bpp = bp; 82 return (0); 83} --- 55 unchanged lines hidden (view full) --- 139 continue; 140 if (vp != ip->i_devvp) 141 continue; 142 /* look for overlap */ 143 if (ep->b_bcount == 0 || ep->b_blkno > last || 144 ep->b_blkno + btodb(ep->b_bcount) <= start) 145 continue; 146 vprint("Disk overlap", vp); |
146 (void)printf("\tstart %d, end %d overlap start %d, end %d\n", 147 start, last, ep->b_blkno, 148 ep->b_blkno + btodb(ep->b_bcount) - 1); | 147 (void)printf("\tstart %lu, end %lu overlap start %lu, end %lu\n", 148 (u_long)start, (u_long)last, (u_long)ep->b_blkno, 149 (u_long)(ep->b_blkno + btodb(ep->b_bcount) - 1)); |
149 panic("Disk buffer overlap"); 150 } 151} 152#endif /* DIAGNOSTIC */ 153 154/* 155 * block operations 156 * --- 83 unchanged lines hidden --- | 150 panic("Disk buffer overlap"); 151 } 152} 153#endif /* DIAGNOSTIC */ 154 155/* 156 * block operations 157 * --- 83 unchanged lines hidden --- |