Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_vfs.c
Show All 30 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/sbuf.h> | |||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <geom/geom.h> | #include <geom/geom.h> | ||||
#include <geom/geom_vfs.h> | #include <geom/geom_vfs.h> | ||||
/* | /* | ||||
* subroutines for use by filesystems. | * subroutines for use by filesystems. | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | if (mp != NULL) { | ||||
} | } | ||||
} | } | ||||
VI_UNLOCK(vp); | VI_UNLOCK(vp); | ||||
} | } | ||||
cp = bip->bio_from; | cp = bip->bio_from; | ||||
sc = cp->geom->softc; | sc = cp->geom->softc; | ||||
if (bip->bio_error) { | if (bip->bio_error) { | ||||
printf("g_vfs_done():"); | #ifndef PRINTF_BUFR_SIZE | ||||
g_print_bio(bip); | #define PRINTF_BUFR_SIZE 64 | ||||
printf("error = %d\n", bip->bio_error); | #endif | ||||
char bufr[PRINTF_BUFR_SIZE]; | |||||
struct sbuf sb, *sbp __unused; | |||||
sbp = sbuf_new(&sb, bufr, sizeof(bufr), SBUF_FIXEDLEN); | |||||
KASSERT(sbp != NULL, ("sbuf_new misused?")); | |||||
sbuf_set_drain(&sb, sbuf_printf_drain, NULL); | |||||
sbuf_cat(&sb, "g_vfs_done():"); | |||||
g_format_bio(&sb, bip); | |||||
sbuf_printf(&sb, "error = %d\n", bip->bio_error); | |||||
sbuf_finish(&sb); | |||||
sbuf_delete(&sb); | |||||
} | } | ||||
bp->b_error = bip->bio_error; | bp->b_error = bip->bio_error; | ||||
bp->b_ioflags = bip->bio_flags; | bp->b_ioflags = bip->bio_flags; | ||||
if (bip->bio_error) | if (bip->bio_error) | ||||
bp->b_ioflags |= BIO_ERROR; | bp->b_ioflags |= BIO_ERROR; | ||||
bp->b_resid = bp->b_bcount - bip->bio_completed; | bp->b_resid = bp->b_bcount - bip->bio_completed; | ||||
g_destroy_bio(bip); | g_destroy_bio(bip); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |