Re: [PATCH] AFS: Fix file locking

From: Andrew Morton
Date: Tue Jul 17 2007 - 20:50:54 EST


On Tue, 17 Jul 2007 13:47:32 +0100
David Howells <dhowells@xxxxxxxxxx> wrote:

> + if (type == AFS_LOCK_READ &&
> + vnode->flags & (1 << AFS_VNODE_READLOCKED)) {

Here we use

vnode->flags & (1 << foo)

> + set_bit(AFS_VNODE_LOCKING, &vnode->flags);

and elsewhere we use set_bit(foo, &vnode->flags) and clear_bit()

This is a bit strange. Does the open-coded bit-test have any performance
benefit on any architecture? Not on x86 at least, afaik.

Please consider converting all that stuff to test_bit() sometime. It sure
would look a lot better.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/