Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Tejun Heo
Hello, (Sasha, would it be possible to change your MUA so that it breaks long lines. It's pretty difficult to reply to.) On Wed, Aug 15, 2012 at 02:24:49AM +0200, Sasha Levin wrote: > The hashtable uses hlist. hlist provides us with an entire family of > init functions which I'm supposed to

Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Sasha Levin
On 08/15/2012 01:25 AM, NeilBrown wrote: > On Tue, 14 Aug 2012 18:24:35 +0200 Sasha Levin > wrote: > > >> +static inline void hash_init_size(struct hlist_head *hashtable, int bits) >> +{ >> +int i; >> + >> +for (i = 0; i < HASH_SIZE(bits); i++) >> +INIT_HLIST_HEAD(hashtable

Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread NeilBrown
On Tue, 14 Aug 2012 18:24:35 +0200 Sasha Levin wrote: > +static inline void hash_init_size(struct hlist_head *hashtable, int bits) > +{ > + int i; > + > + for (i = 0; i < HASH_SIZE(bits); i++) > + INIT_HLIST_HEAD(hashtable + i); > +} This seems like an inefficient way to do

[PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Sasha Levin
This hashtable implementation is using hlist buckets to provide a simple hashtable to prevent it from getting reimplemented all over the kernel. Signed-off-by: Sasha Levin --- include/linux/hashtable.h | 284 + 1 files changed, 284 insertions(+), 0

[PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Sasha Levin
This hashtable implementation is using hlist buckets to provide a simple hashtable to prevent it from getting reimplemented all over the kernel. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- include/linux/hashtable.h | 284 + 1 files changed,

Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread NeilBrown
On Tue, 14 Aug 2012 18:24:35 +0200 Sasha Levin levinsasha...@gmail.com wrote: +static inline void hash_init_size(struct hlist_head *hashtable, int bits) +{ + int i; + + for (i = 0; i HASH_SIZE(bits); i++) + INIT_HLIST_HEAD(hashtable + i); +} This seems like an

Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Sasha Levin
On 08/15/2012 01:25 AM, NeilBrown wrote: On Tue, 14 Aug 2012 18:24:35 +0200 Sasha Levin levinsasha...@gmail.com wrote: +static inline void hash_init_size(struct hlist_head *hashtable, int bits) +{ +int i; + +for (i = 0; i HASH_SIZE(bits); i++) +

Re: [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Tejun Heo
Hello, (Sasha, would it be possible to change your MUA so that it breaks long lines. It's pretty difficult to reply to.) On Wed, Aug 15, 2012 at 02:24:49AM +0200, Sasha Levin wrote: The hashtable uses hlist. hlist provides us with an entire family of init functions which I'm supposed to use