mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: linux-kernel@vger.kernel.org, cluster-devel@redhat.com
Subject: Re: [PATCH 1/3] bitops: Add __ffs64 bitop
Date: Mon, 27 Apr 2009 09:40:35 -0400	[thread overview]
Message-ID: <52615.1240839635@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Thu, 23 Apr 2009 10:16:54 BST." <1240478216-2594-2-git-send-email-swhiteho@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

On Thu, 23 Apr 2009 10:16:54 BST, Steven Whitehouse said:
> Finds the first set bit in a 64 bit word. This is required in order
> to fix a bug in GFS2, but I think it should be a generic function
> in case of future users.

Seems like a sane idea..

> +static inline unsigned long __ffs64(u64 word)
> +{
> +#if BITS_PER_LONG == 32
> +	if (((u32)word) == 0UL)
> +		return __ffs((u32)(word >> 32)) + 32;
> +#elif BITS_PER_LONG != 64
> +#error BITS_PER_LONG not 32 or 64
> +#endif
> +	return __ffs((unsigned long)word);
> +}
> +

Does this have endian-ness issues (is that (u32)word the "high" or "low"
part)?  Or is this intended only for looking at bitmaps and the like, and we
don't really care?

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

  parent reply	other threads:[~2009-04-27 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  9:16 GFS2: Block alloc fixes Steven Whitehouse
2009-04-23  9:16 ` [PATCH 1/3] bitops: Add __ffs64 bitop Steven Whitehouse
2009-04-23  9:16   ` [PATCH 2/3] GFS2: Fix bug in block allocation Steven Whitehouse
2009-04-23  9:16     ` [PATCH 3/3] GFS2: Ensure that the inode goal block settings are updated Steven Whitehouse
2009-04-27 13:40   ` Valdis.Kletnieks [this message]
2009-04-27 15:41     ` [PATCH 1/3] bitops: Add __ffs64 bitop Steven Whitehouse
2009-04-27 16:31       ` Valdis.Kletnieks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52615.1240839635@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®