diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2015-11-28 21:52:03 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2015-11-28 21:52:03 +0000 |
commit | e405dde65ba2198dcfea0f634e09795a2e899c28 (patch) | |
tree | 4035f25440bc6f0781b890a3a8550e69f2a06d33 /sys/ufs/ffs | |
parent | acf349b4efe1192e8a6398f701bb37173312f733 (diff) |
move buffer size adjustment to buf_adjcnt - from Walter Neto
ok mpi@
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_balloc.c | 6 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_subr.c | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 87840a18699..152b42c9f5d 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_alloc.c,v 1.105 2015/09/27 05:25:00 guenther Exp $ */ +/* $OpenBSD: ffs_alloc.c,v 1.106 2015/11/28 21:52:02 beck Exp $ */ /* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */ /* @@ -218,7 +218,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, if (bpp != NULL) { if ((error = bread(ITOV(ip), lbprev, fs->fs_bsize, &bp)) != 0) goto error; - bp->b_bcount = osize; + buf_adjcnt(bp, osize); } if ((error = ufs_quota_alloc_blocks(ip, btodb(nsize - osize), cred)) @@ -241,7 +241,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, if (nsize > bp->b_bufsize) panic("ffs_realloccg: small buf"); #endif - bp->b_bcount = nsize; + buf_adjcnt(bp, nsize); bp->b_flags |= B_DONE; memset(bp->b_data + osize, 0, nsize - osize); *bpp = bp; @@ -313,7 +313,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, if (nsize > bp->b_bufsize) panic("ffs_realloccg: small buf 2"); #endif - bp->b_bcount = nsize; + buf_adjcnt(bp, nsize); bp->b_flags |= B_DONE; memset(bp->b_data + osize, 0, nsize - osize); *bpp = bp; diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index e4b21cd3179..ca1c80d804b 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_balloc.c,v 1.43 2015/03/14 03:38:52 jsg Exp $ */ +/* $OpenBSD: ffs_balloc.c,v 1.44 2015/11/28 21:52:02 beck Exp $ */ /* $NetBSD: ffs_balloc.c,v 1.3 1996/02/09 22:22:21 christos Exp $ */ /* @@ -165,7 +165,7 @@ ffs1_balloc(struct inode *ip, off_t startoffset, int size, struct ucred *cred, brelse(*bpp); return (error); } - (*bpp)->b_bcount = osize; + buf_adjcnt((*bpp), osize); } return (0); } else { @@ -535,7 +535,7 @@ ffs2_balloc(struct inode *ip, off_t off, int size, struct ucred *cred, brelse(*bpp); return (error); } - (*bpp)->b_bcount = osize; + buf_adjcnt((*bpp), osize); } return (0); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 670a23e83a4..82c1b87c3e1 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_inode.c,v 1.74 2015/03/14 03:38:52 jsg Exp $ */ +/* $OpenBSD: ffs_inode.c,v 1.75 2015/11/28 21:52:02 beck Exp $ */ /* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */ /* @@ -262,7 +262,7 @@ ffs_truncate(struct inode *oip, off_t length, int flags, struct ucred *cred) (void) uvm_vnp_uncache(ovp); if (ovp->v_type != VDIR) memset(bp->b_data + offset, 0, size - offset); - bp->b_bcount = size; + buf_adjcnt(bp, size); if (aflags & B_SYNC) bwrite(bp); else diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index c075f1e633e..3da51515e37 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_subr.c,v 1.29 2013/11/02 00:08:17 krw Exp $ */ +/* $OpenBSD: ffs_subr.c,v 1.30 2015/11/28 21:52:02 beck Exp $ */ /* $NetBSD: ffs_subr.c,v 1.6 1996/03/17 02:16:23 christos Exp $ */ /* @@ -72,7 +72,7 @@ ffs_bufatoff(struct inode *ip, off_t offset, char **res, struct buf **bpp) brelse(bp); return (error); } - bp->b_bcount = bsize; + buf_adjcnt(bp, bsize); if (res) *res = (char *)bp->b_data + blkoff(fs, offset); *bpp = bp; |