diff options
author | Ken Smith <kensmith@FreeBSD.org> | 2004-05-14 23:03:50 +0000 |
---|---|---|
committer | Ken Smith <kensmith@FreeBSD.org> | 2004-05-14 23:03:50 +0000 |
commit | ce57821091ac8bae40268c0241ef214cdcaa41df (patch) | |
tree | 357d485ecc3ee70581905547976c844bf272c36d | |
parent | 1e2ade94cccef74d5ff877d3a405433c5b1af455 (diff) | |
download | src-ce57821091ac8bae40268c0241ef214cdcaa41df.tar.gz src-ce57821091ac8bae40268c0241ef214cdcaa41df.zip |
MFS of rev 1.64.2.4: 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.
Approved by: re (bmah)
Notes
Notes:
svn path=/releng/4.10/; revision=129246
-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 d66281d63668..bc9a479f030f 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -238,7 +238,11 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) 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); } @@ -303,7 +307,11 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) 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); } |