Add more KASSERTS().

This commit is contained in:
Poul-Henning Kamp 2003-09-26 20:52:46 +00:00
parent c4f02a891f
commit 3eb6ffdf43
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120493

View file

@ -384,6 +384,9 @@ g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error)
void *ptr;
int errorc;
KASSERT(length >= 512 && length <= DFLTPHYS,
("g_read_data(): invalid length %jd", (intmax_t)length));
bp = g_new_bio();
bp->bio_cmd = BIO_READ;
bp->bio_done = NULL;
@ -409,6 +412,9 @@ g_write_data(struct g_consumer *cp, off_t offset, void *ptr, off_t length)
struct bio *bp;
int error;
KASSERT(length >= 512 && length <= DFLTPHYS,
("g_write_data(): invalid length %jd", (intmax_t)length));
bp = g_new_bio();
bp->bio_cmd = BIO_WRITE;
bp->bio_done = NULL;