Skip to content

Commit

Permalink
GFS2: use memchr_inv
Browse files Browse the repository at this point in the history
Use memchr_inv to verify that the specified memory range is cleared.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: cluster-devel@redhat.com
Cc: Christine Caulfield <ccaulfie@redhat.com>
Cc: David Teigland <teigland@redhat.com>
  • Loading branch information
Akinobu Mita authored and Steven Whitehouse committed Apr 4, 2013
1 parent 57c7310 commit 4146c3d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions fs/gfs2/lock_dlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4146c3d

Please sign in to comment.