Deleted Added
full compact
ffs_rawread.c (112694) ffs_rawread.c (112718)
1/*-
2 * Copyright (c) 2000-2003 Tor Egge
3 * 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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2000-2003 Tor Egge
3 * 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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/ufs/ffs/ffs_rawread.c 112694 2003-03-26 23:40:42Z tegge $
26 * $FreeBSD: head/sys/ufs/ffs/ffs_rawread.c 112718 2003-03-27 19:28:11Z tegge $
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/fcntl.h>
32#include <sys/file.h>
33#include <sys/stat.h>
34#include <sys/proc.h>

--- 295 unchanged lines hidden (view full) ---

330 relpbuf(nbp, &ffsrawbufcnt);
331 nbp = NULL;
332 }
333 }
334 }
335 }
336
337 spl = splbio();
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/fcntl.h>
32#include <sys/file.h>
33#include <sys/stat.h>
34#include <sys/proc.h>

--- 295 unchanged lines hidden (view full) ---

330 relpbuf(nbp, &ffsrawbufcnt);
331 nbp = NULL;
332 }
333 }
334 }
335 }
336
337 spl = splbio();
338 while ((bp->b_flags & B_DONE) == 0) {
339 tsleep((caddr_t)bp, PRIBIO, "rawrd", 0);
340 }
338 bwait(bp, PRIBIO, "rawrd");
341 splx(spl);
342
343 vunmapbuf(bp);
344
345 iolen = bp->b_bcount - bp->b_resid;
346 if (iolen == 0 && (bp->b_ioflags & BIO_ERROR) == 0) {
347 nerror = 0; /* Ignore possible beyond EOF error */
348 break; /* EOF */

--- 55 unchanged lines hidden (view full) ---

404 break;
405 }
406 }
407
408 if (bp != NULL)
409 relpbuf(bp, &ffsrawbufcnt);
410 if (nbp != NULL) { /* Run down readahead buffer */
411 spl = splbio();
339 splx(spl);
340
341 vunmapbuf(bp);
342
343 iolen = bp->b_bcount - bp->b_resid;
344 if (iolen == 0 && (bp->b_ioflags & BIO_ERROR) == 0) {
345 nerror = 0; /* Ignore possible beyond EOF error */
346 break; /* EOF */

--- 55 unchanged lines hidden (view full) ---

402 break;
403 }
404 }
405
406 if (bp != NULL)
407 relpbuf(bp, &ffsrawbufcnt);
408 if (nbp != NULL) { /* Run down readahead buffer */
409 spl = splbio();
412 while ((nbp->b_flags & B_DONE) == 0) {
413 tsleep((caddr_t)nbp, PRIBIO, "rawrd", 0);
414 }
410 bwait(nbp, PRIBIO, "rawrd");
415 splx(spl);
416 vunmapbuf(nbp);
417 relpbuf(nbp, &ffsrawbufcnt);
418 }
419
420 if (error == 0)
421 error = nerror;
422 PRELE(td->td_proc);

--- 66 unchanged lines hidden (view full) ---

489 *workdone = 0;
490 return 0;
491}
492
493
494static void
495ffs_rawreadwakeup(struct buf *bp)
496{
411 splx(spl);
412 vunmapbuf(nbp);
413 relpbuf(nbp, &ffsrawbufcnt);
414 }
415
416 if (error == 0)
417 error = nerror;
418 PRELE(td->td_proc);

--- 66 unchanged lines hidden (view full) ---

485 *workdone = 0;
486 return 0;
487}
488
489
490static void
491ffs_rawreadwakeup(struct buf *bp)
492{
497 wakeup((caddr_t) bp);
493 bdone(bp);
498}
494}