Deleted Added
full compact
vm_pager.c (58934) vm_pager.c (59249)
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
57 * School of Computer Science
58 * Carnegie Mellon University
59 * Pittsburgh PA 15213-3890
60 *
61 * any improvements or extensions that they make and grant Carnegie the
62 * rights to redistribute these changes.
63 *
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
57 * School of Computer Science
58 * Carnegie Mellon University
59 * Pittsburgh PA 15213-3890
60 *
61 * any improvements or extensions that they make and grant Carnegie the
62 * rights to redistribute these changes.
63 *
64 * $FreeBSD: head/sys/vm/vm_pager.c 58934 2000-04-02 15:24:56Z phk $
64 * $FreeBSD: head/sys/vm/vm_pager.c 59249 2000-04-15 05:54:02Z phk $
65 */
66
67/*
68 * Paging space routine stubs. Emulates a matchmaker-like interface
69 * for builtin pagers.
70 */
71
72#include <sys/param.h>

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

264void
265vm_pager_strategy(vm_object_t object, struct buf *bp)
266{
267 if (pagertab[object->type]->pgo_strategy) {
268 (*pagertab[object->type]->pgo_strategy)(object, bp);
269 } else {
270 bp->b_ioflags |= BIO_ERROR;
271 bp->b_error = ENXIO;
65 */
66
67/*
68 * Paging space routine stubs. Emulates a matchmaker-like interface
69 * for builtin pagers.
70 */
71
72#include <sys/param.h>

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

264void
265vm_pager_strategy(vm_object_t object, struct buf *bp)
266{
267 if (pagertab[object->type]->pgo_strategy) {
268 (*pagertab[object->type]->pgo_strategy)(object, bp);
269 } else {
270 bp->b_ioflags |= BIO_ERROR;
271 bp->b_error = ENXIO;
272 biodone(bp);
272 bufdone(bp);
273 }
274}
275
276/*
277 * vm_pager_get_pages() - inline, see vm/vm_pager.h
278 * vm_pager_put_pages() - inline, see vm/vm_pager.h
279 * vm_pager_has_page() - inline, see vm/vm_pager.h
280 * vm_pager_page_inserted() - inline, see vm/vm_pager.h

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

513 wakeup(bp);
514 }
515 if (!bp->b_chain.count && (bp->b_flags & B_AUTOCHAINDONE)) {
516 bp->b_flags &= ~B_AUTOCHAINDONE;
517 if (bp->b_resid != 0 && !(bp->b_ioflags & BIO_ERROR)) {
518 bp->b_ioflags |= BIO_ERROR;
519 bp->b_error = EINVAL;
520 }
273 }
274}
275
276/*
277 * vm_pager_get_pages() - inline, see vm/vm_pager.h
278 * vm_pager_put_pages() - inline, see vm/vm_pager.h
279 * vm_pager_has_page() - inline, see vm/vm_pager.h
280 * vm_pager_page_inserted() - inline, see vm/vm_pager.h

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

513 wakeup(bp);
514 }
515 if (!bp->b_chain.count && (bp->b_flags & B_AUTOCHAINDONE)) {
516 bp->b_flags &= ~B_AUTOCHAINDONE;
517 if (bp->b_resid != 0 && !(bp->b_ioflags & BIO_ERROR)) {
518 bp->b_ioflags |= BIO_ERROR;
519 bp->b_error = EINVAL;
520 }
521 biodone(bp);
521 bufdone(bp);
522 }
523 }
524 nbp->b_flags |= B_DONE;
525 nbp->b_flags &= ~B_ASYNC;
526 relpbuf(nbp, NULL);
527}
528
529/*

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

563{
564 if (nbp->b_bcount) {
565 nbp->b_bufsize = nbp->b_bcount;
566 if (nbp->b_iocmd == BIO_WRITE)
567 nbp->b_dirtyend = nbp->b_bcount;
568 BUF_KERNPROC(nbp);
569 BUF_STRATEGY(nbp);
570 } else {
522 }
523 }
524 nbp->b_flags |= B_DONE;
525 nbp->b_flags &= ~B_ASYNC;
526 relpbuf(nbp, NULL);
527}
528
529/*

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

563{
564 if (nbp->b_bcount) {
565 nbp->b_bufsize = nbp->b_bcount;
566 if (nbp->b_iocmd == BIO_WRITE)
567 nbp->b_dirtyend = nbp->b_bcount;
568 BUF_KERNPROC(nbp);
569 BUF_STRATEGY(nbp);
570 } else {
571 biodone(nbp);
571 bufdone(nbp);
572 }
573}
574
575void
576waitchainbuf(struct buf *bp, int count, int done)
577{
578 int s;
579
580 s = splbio();
581 while (bp->b_chain.count > count) {
582 bp->b_flags |= B_WANT;
583 tsleep(bp, PRIBIO + 4, "bpchain", 0);
584 }
585 if (done) {
586 if (bp->b_resid != 0 && !(bp->b_ioflags & BIO_ERROR)) {
587 bp->b_ioflags |= BIO_ERROR;
588 bp->b_error = EINVAL;
589 }
572 }
573}
574
575void
576waitchainbuf(struct buf *bp, int count, int done)
577{
578 int s;
579
580 s = splbio();
581 while (bp->b_chain.count > count) {
582 bp->b_flags |= B_WANT;
583 tsleep(bp, PRIBIO + 4, "bpchain", 0);
584 }
585 if (done) {
586 if (bp->b_resid != 0 && !(bp->b_ioflags & BIO_ERROR)) {
587 bp->b_ioflags |= BIO_ERROR;
588 bp->b_error = EINVAL;
589 }
590 biodone(bp);
590 bufdone(bp);
591 }
592 splx(s);
593}
594
595void
596autochaindone(struct buf *bp)
597{
598 int s;
599
600 s = splbio();
601 if (bp->b_chain.count == 0)
591 }
592 splx(s);
593}
594
595void
596autochaindone(struct buf *bp)
597{
598 int s;
599
600 s = splbio();
601 if (bp->b_chain.count == 0)
602 biodone(bp);
602 bufdone(bp);
603 else
604 bp->b_flags |= B_AUTOCHAINDONE;
605 splx(s);
606}
607
603 else
604 bp->b_flags |= B_AUTOCHAINDONE;
605 splx(s);
606}
607