diff options
author | Alan Cox <alc@FreeBSD.org> | 2009-05-17 20:26:00 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2009-05-17 20:26:00 +0000 |
commit | 6e5982caf709ddf16c36a32e34fc36c49194f561 (patch) | |
tree | e3ab31a35178114fbfd380d8fa1208bcaf90f814 /sys/ufs/ffs/ffs_alloc.c | |
parent | afb8a6b50015962e1f807307111b35c49a763809 (diff) | |
download | src-6e5982caf709ddf16c36a32e34fc36c49194f561.tar.gz src-6e5982caf709ddf16c36a32e34fc36c49194f561.zip |
Introduce vfs_bio_set_valid() and use it from ffs_realloccg(). This
eliminates the misuse of vfs_bio_clrbuf() by ffs_realloccg().
In collaboration with: tegge
Notes
Notes:
svn path=/head/; revision=192260
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 4748f682101c..b4f001e6c677 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -326,10 +326,9 @@ retry: ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO) - bzero((char *)bp->b_data + osize, nsize - osize); - else - vfs_bio_clrbuf(bp); + bzero(bp->b_data + osize, nsize - osize); + if ((bp->b_flags & (B_MALLOC | B_VMIO)) == B_VMIO) + vfs_bio_set_valid(bp, osize, nsize - osize); *bpp = bp; return (0); } @@ -404,10 +403,9 @@ retry: ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO) - bzero((char *)bp->b_data + osize, nsize - osize); - else - vfs_bio_clrbuf(bp); + bzero(bp->b_data + osize, nsize - osize); + if ((bp->b_flags & (B_MALLOC | B_VMIO)) == B_VMIO) + vfs_bio_set_valid(bp, osize, nsize - osize); *bpp = bp; return (0); } |