Skip to contentSkip to conversation

gfs2: use memchr_inv

PATCH RESEND New Akinobu Mita 1 participant 1 message Mar 7, 2013 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 gfs2: use memchr_inv

Use memchr_inv to verify that the specified memory range is cleared.

Cc Steven Whitehouse <[email protected]>
Cc cluster-devel at redhat.com
Cc Christine Caulfield <[email protected]>
Cc David Teigland <[email protected]>
---
 fs/gfs2/lock_dlm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
fs/gfs2/lock_dlm.c +2 -6
index 9802de0..b56befa 100644
@@ -483,12 +483,8 @@ static void control_lvb_write(struct lm_lockstruct *ls, uint32_t lvb_gen,
 
 static int all_jid_bits_clear(char *lvb)
 {
-	int i;
-	for (i = JID_BITMAP_OFFSET; i < GDLM_LVB_SIZE; i++) {
-		if (lvb[i])
-			return 0;
-	}
-	return 1;
+	return !memchr_inv(lvb + JID_BITMAP_OFFSET, 0,
+			GDLM_LVB_SIZE - JID_BITMAP_OFFSET);
 }
 
 static void sync_wait_cb(void *arg)
Signature · 1 line
1.8.1.2