Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coypoop/e5bab3dc10445112d9a376b92a4c1f4e to your computer and use it in GitHub Desktop.
Save coypoop/e5bab3dc10445112d9a376b92a4c1f4e to your computer and use it in GitHub Desktop.
You've partially applied this one:
From 3eb77263e8335b49a4bcb6b0fb5d5529bba630ed Mon Sep 17 00:00:00 2001
From: coypu <coypu@sdf.org>
Date: Sat, 7 May 2016 19:32:49 +0300
Subject: [PATCH 2/2] Split big KASSERT into two KASSERTs.
---
sys/kern/vfs_wapbl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/kern/vfs_wapbl.c b/sys/kern/vfs_wapbl.c
index 885c6b8..efc2d59 100644
--- a/sys/kern/vfs_wapbl.c
+++ b/sys/kern/vfs_wapbl.c
@@ -1507,8 +1507,8 @@ wapbl_flush(struct wapbl *wl, int waitfor)
goto abort;
off = wl->wl_head;
- KASSERT((off == 0) || ((off >= wl->wl_circ_off) &&
- (off < wl->wl_circ_off + wl->wl_circ_size)));
+ KASSERT((off == 0) || (off >= wl->wl_circ_off));
+ KASSERT((off == 0) || (off < wl->wl_circ_off + wl->wl_circ_size));
error = wapbl_write_blocks(wl, &off);
if (error)
goto abort;
@@ -2139,8 +2139,8 @@ wapbl_write_blocks(struct wapbl *wl, off_t *offp)
* bwrite when the vnode lock should already be held
* by the invoking code.
*/
- KASSERT((bp->b_vp->v_type == VBLK) ||
- (bp->b_blkno != bp->b_lblkno));
+ KASSERT(bp->b_vp->v_type == VBLK);
+ KASSERT(bp->b_blkno != bp->b_lblkno);
KASSERT(bp->b_blkno > 0);
wc->wc_blocks[wc->wc_blkcount].wc_daddr = bp->b_blkno;
--
2.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment