]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Round up/down min/max_size to ensure we respect limit
authorThomas Graf <tgraf@suug.ch>
Thu, 19 Mar 2015 22:31:13 +0000 (22:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Mar 2015 01:02:23 +0000 (21:02 -0400)
commitf9fbf565daef1ccbde8568213ba0b6bc46c35adb
tree784c021c158fe38467363f023401520872c4ab30
parentfb62f974954b3a8286b6467cb1631b97260772ae
rhashtable: Round up/down min/max_size to ensure we respect limit

Round up min_size respectively round down max_size to the next power
of two to make sure we always respect the limit specified by the
user. This is required because we compare the table size against the
limit before we expand or shrink.

Also fixes a minor bug where we modified min_size in the params
provided instead of the copy stored in struct rhashtable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c