summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_softdep.c
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2008-06-14 10:55:22 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2008-06-14 10:55:22 +0000
commitace977b163a487262367b29bf0a11c9438cd3480 (patch)
treea9aacbf84fd80fdaa00d85a1f4cf5d4d21c7ae8d /sys/ufs/ffs/ffs_softdep.c
parent4ef5afc9653e726120eef49602859549321429b8 (diff)
A bunch of pool_get() + bzero() -> pool_get(..., .. | PR_ZERO)
conversions that should shave a few bytes off the kernel. ok henning, krw, jsing, oga, miod, and thib (``even though i usually prefer FOO|BAR''; thanks for looking.
Diffstat (limited to 'sys/ufs/ffs/ffs_softdep.c')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index b7ef8b81994..7c6959df7a9 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.97 2008/06/12 06:58:40 deraadt Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.98 2008/06/14 10:55:21 mk Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -1027,8 +1027,7 @@ top:
ACQUIRE_LOCK(&lk);
goto top;
}
- pagedep = pool_get(&pagedep_pool, PR_WAITOK);
- bzero(pagedep, sizeof(struct pagedep));
+ pagedep = pool_get(&pagedep_pool, PR_WAITOK | PR_ZERO);
pagedep->pd_list.wk_type = D_PAGEDEP;
pagedep->pd_mnt = mp;
pagedep->pd_ino = ip->i_number;
@@ -1452,8 +1451,7 @@ softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
struct pagedep *pagedep;
struct newblk *newblk;
- adp = pool_get(&allocdirect_pool, PR_WAITOK);
- bzero(adp, sizeof(struct allocdirect));
+ adp = pool_get(&allocdirect_pool, PR_WAITOK | PR_ZERO);
adp->ad_list.wk_type = D_ALLOCDIRECT;
adp->ad_lbn = lbn;
adp->ad_newblkno = newblkno;
@@ -1700,8 +1698,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno)
{
struct allocindir *aip;
- aip = pool_get(&allocindir_pool, PR_WAITOK);
- bzero(aip,sizeof(struct allocindir));
+ aip = pool_get(&allocindir_pool, PR_WAITOK | PR_ZERO);
aip->ai_list.wk_type = D_ALLOCINDIR;
aip->ai_state = ATTACHED;
aip->ai_offset = ptrno;
@@ -1928,8 +1925,7 @@ softdep_setup_freeblocks(ip, length)
fs = ip->i_fs;
if (length != 0)
panic("softdep_setup_freeblocks: non-zero length");
- freeblks = pool_get(&freeblks_pool, PR_WAITOK);
- bzero(freeblks, sizeof(struct freeblks));
+ freeblks = pool_get(&freeblks_pool, PR_WAITOK | PR_ZERO);
freeblks->fb_list.wk_type = D_FREEBLKS;
freeblks->fb_state = ATTACHED;
freeblks->fb_uid = DIP(ip, uid);
@@ -2621,8 +2617,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
fs = dp->i_fs;
lbn = lblkno(fs, diroffset);
offset = blkoff(fs, diroffset);
- dap = pool_get(&diradd_pool, PR_WAITOK);
- bzero(dap,sizeof(struct diradd));
+ dap = pool_get(&diradd_pool, PR_WAITOK | PR_ZERO);
dap->da_list.wk_type = D_DIRADD;
dap->da_offset = offset;
dap->da_newinum = newinum;
@@ -2929,8 +2924,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
if (num_dirrem > max_softdeps / 2)
(void) request_cleanup(FLUSH_REMOVE, 0);
num_dirrem += 1;
- dirrem = pool_get(&dirrem_pool, PR_WAITOK);
- bzero(dirrem,sizeof(struct dirrem));
+ dirrem = pool_get(&dirrem_pool, PR_WAITOK | PR_ZERO);
dirrem->dm_list.wk_type = D_DIRREM;
dirrem->dm_state = isrmdir ? RMDIR : 0;
dirrem->dm_mnt = ITOV(ip)->v_mount;
@@ -3018,14 +3012,13 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
int isrmdir; /* indicates if doing RMDIR */
{
int offset;
- struct diradd *dap = NULL;
+ struct diradd *dap;
struct dirrem *dirrem, *prevdirrem;
struct pagedep *pagedep;
struct inodedep *inodedep;
offset = blkoff(dp->i_fs, dp->i_offset);
- dap = pool_get(&diradd_pool, PR_WAITOK);
- bzero(dap,sizeof(struct diradd));
+ dap = pool_get(&diradd_pool, PR_WAITOK | PR_ZERO);
dap->da_list.wk_type = D_DIRADD;
dap->da_state = DIRCHG | ATTACHED | DEPCOMPLETE;
dap->da_offset = offset;