lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 16 Oct 2010 20:51:50 +1100
From:	Nick Piggin <npiggin@...nel.dk>
To:	Dave Chinner <david@...morbit.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/19] kernel: add bl_list

On Sat, Oct 16, 2010 at 07:13:56PM +1100, Dave Chinner wrote:
> From: Nick Piggin <npiggin@...e.de>
> +/**
> + * hlist_bl_lock	- lock a hash list
> + * @h:	hash list head to lock
> + */
> +static inline void hlist_bl_lock(struct hlist_bl_head *h)
> +{
> +	bit_spin_lock(0, (unsigned long *)h);
> +}
> +
> +/**
> + * hlist_bl_unlock	- unlock a hash list
> + * @h:	hash list head to unlock
> + */
> +static inline void hlist_bl_unlock(struct hlist_bl_head *h)
> +{
> +	__bit_spin_unlock(0, (unsigned long *)h);
> +}

I don't know why Christoph asked for these; he's usually against
obfuscating wrapper functions.

bit_spin_lock is fine in callers so please leave it at that.
Other users may not want a spinlock, or might want to use
bit_spin_is_locked, bit_spin_trylock etc.


> diff --git a/include/linux/poison.h b/include/linux/poison.h
> index 2110a81..d367d39 100644
> --- a/include/linux/poison.h
> +++ b/include/linux/poison.h
> @@ -22,6 +22,8 @@
>  #define LIST_POISON1  ((void *) 0x00100100 + POISON_POINTER_DELTA)
>  #define LIST_POISON2  ((void *) 0x00200200 + POISON_POINTER_DELTA)
>  
> +#define BL_LIST_POISON1  ((void *) 0x00300300 + POISON_POINTER_DELTA)
> +#define BL_LIST_POISON2  ((void *) 0x00400400 + POISON_POINTER_DELTA)
>  /********** include/linux/timer.h **********/
>  /*
>   * Magic number "tsta" to indicate a static timer initializer

I don't see the point of this, but if there is one it should be
documented in a different patch and propagated to other types of
lists too. I wouldn't worry about it though.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ