diff options
author | kensmith <kensmith@FreeBSD.org> | 2004-05-14 22:00:08 +0000 |
---|---|---|
committer | kensmith <kensmith@FreeBSD.org> | 2004-05-14 22:00:08 +0000 |
commit | 7e5c41897c31347b9f55811a43c15bf706e04eb5 (patch) | |
tree | 1513854f0ce5dfe822f3487debe270f430875624 /sys/ufs/ffs | |
parent | c16e7cdead1c2914aeb06b86f6d8a7ac18d5b533 (diff) | |
download | FreeBSD-src-7e5c41897c31347b9f55811a43c15bf706e04eb5.zip FreeBSD-src-7e5c41897c31347b9f55811a43c15bf706e04eb5.tar.gz |
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
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 9b58c96..08e90f1 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); } |