From f7dd67d801e19683c7df9f828aec61d04448d1b3 Mon Sep 17 00:00:00 2001 From: Ken Smith Date: Fri, 14 May 2004 22:00:08 +0000 Subject: [PATCH] Change ffs_realloccg() to set the valid bits for the extended part of the fragment to zero the valid parts of a VM_IO buffer. RE would like this to be part of 4.10-RC3 so this will be MFC-ed immediately. Reviewed by: alc, tegge --- sys/ufs/ffs/ffs_alloc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 9b58c962d03..08e90f19e20 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -260,7 +260,11 @@ retry: ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - bzero((char *)bp->b_data + osize, (u_int)nsize - osize); + if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO) + bzero((char *)bp->b_data + osize, + (u_int)nsize - osize); + else + vfs_bio_clrbuf(bp); *bpp = bp; return (0); } @@ -325,7 +329,11 @@ retry: ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - bzero((char *)bp->b_data + osize, (u_int)nsize - osize); + if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO) + bzero((char *)bp->b_data + osize, + (u_int)nsize - osize); + else + vfs_bio_clrbuf(bp); *bpp = bp; return (0); }