Download raw body.
Remove inconsistent NULL check in ffs_realloccg
ffs_realloccg() always sets *bpp to NULL at the start, so checking bpp
!= NULL later is unnecessary. Remove the useless check.
Also improve code style in quota allocation check.
OK?
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 14822193a03..64c4e715709 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -178,8 +178,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize,
u_int cg;
daddr_t bprev, bno;
- if (bpp != NULL)
- *bpp = NULL;
+ *bpp = NULL;
fs = ip->i_fs;
#ifdef DIAGNOSTIC
if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
@@ -206,14 +205,12 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize,
/*
* Allocate the extra space in the buffer.
*/
- if (bpp != NULL) {
- if ((error = bread(ITOV(ip), lbprev, fs->fs_bsize, &bp)) != 0)
- goto error;
- buf_adjcnt(bp, osize);
- }
+ if ((error = bread(ITOV(ip), lbprev, fs->fs_bsize, &bp)) != 0)
+ goto error;
+ buf_adjcnt(bp, osize);
- if ((error = ufs_quota_alloc_blocks(ip, btodb(nsize - osize), cred))
- != 0)
+ error = ufs_quota_alloc_blocks(ip, btodb(nsize - osize), cred);
+ if (error != 0)
goto error;
quota_updated = btodb(nsize - osize);
Remove inconsistent NULL check in ffs_realloccg