flex_array: flex_array_prealloc takes a number of elements, not an end
authorEric Paris <eparis@redhat.com>
Thu, 28 Apr 2011 19:55:52 +0000 (15:55 -0400)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:14 +0000 (14:23 -0500)
commit8718a057e8148f075deddec228b0da0f5d82dd06
tree47e969da62e427366db2045dee26bd0b1b2022cb
parentcd0740ad9aa67c48902eaea1e73c5e6bc00dbb09
flex_array: flex_array_prealloc takes a number of elements, not an end

BugLink: http://bugs.launchpad.net/bugs/780546

commit 5d30b10bd68df007e7ae21e77d1e0ce184b53040 upstream.

Change flex_array_prealloc to take the number of elements for which space
should be allocated instead of the last (inclusive) element. Users
and documentation are updated accordingly.  flex_arrays got introduced before
they had users.  When folks started using it, they ended up needing a
different API than was coded up originally.  This swaps over to the API that
folks apparently need.

Based-on-patch-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Tested-by: Chris Richards <gizmo@giz-works.com>
Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Documentation/flexible-arrays.txt
include/linux/flex_array.h
lib/flex_array.c
security/selinux/ss/policydb.c