Reinette Chatre 01a3ee2b20 [PATCH] bitmap: parse input from kernel and user buffers
lib/bitmap.c:bitmap_parse() is a library function that received as input a
user buffer.  This seemed to have originated from the way the write_proc
function of the /proc filesystem operates.

This has been reworked to not use kmalloc and eliminates a lot of
get_user() overhead by performing one access_ok before using __get_user().

We need to test if we are in kernel or user space (is_user) and access the
buffer differently.  We cannot use __get_user() to access kernel addresses
in all cases, for example in architectures with separate address space for
kernel and user.

This function will be useful for other uses as well; for example, taking
input for /sysfs instead of /proc, so it was changed to accept kernel
buffers.  We have this use for the Linux UWB project, as part as the
upcoming bandwidth allocator code.

Only a few routines used this function and they were changed too.

Signed-off-by: Reinette Chatre <reinette.chatre@linux.intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-11 11:14:22 -07:00
..
2006-09-26 17:40:24 -04:00
2006-10-03 23:01:26 +02:00
2006-10-03 23:01:26 +02:00
2006-10-01 00:39:29 -07:00
2006-08-31 00:02:15 -04:00
2006-09-28 17:53:58 -07:00
2006-10-04 08:31:24 -04:00
2006-01-13 09:12:21 -08:00
2006-10-03 23:01:26 +02:00
2006-10-04 19:32:09 +02:00
2006-10-10 15:37:22 -07:00
2006-09-22 23:24:30 -04:00
2006-10-10 15:37:20 -07:00
2006-06-09 16:14:20 -04:00
2006-02-23 09:56:38 +00:00
2006-10-03 08:04:16 -07:00
2006-07-03 19:44:51 -07:00
2006-05-08 16:32:05 -07:00
2006-09-26 08:48:54 -07:00
2006-06-23 02:07:36 -07:00
2006-10-11 11:14:17 -07:00
2006-03-31 12:18:54 -08:00
2006-09-22 15:18:47 -07:00
2006-06-25 10:01:19 -07:00
2006-07-28 21:02:00 -07:00
2006-10-02 07:57:12 -07:00
2006-09-26 17:40:24 -04:00
2006-03-26 08:56:56 -08:00
2006-10-04 07:55:30 -07:00
2006-09-26 15:38:52 -07:00
2006-09-28 18:02:18 -07:00
2006-09-28 18:02:13 -07:00
2005-11-08 09:40:47 -08:00
2006-09-28 18:02:02 -07:00
2006-09-28 18:02:31 -07:00
2006-10-04 00:31:09 -07:00
2006-09-28 18:02:29 -07:00
2006-10-02 07:57:22 -07:00
2006-10-08 12:32:36 -07:00
2006-10-10 15:37:22 -07:00
2006-08-21 10:02:50 +02:00
2006-10-04 00:31:09 -07:00
2006-10-04 07:55:12 -07:00
2006-10-04 00:31:09 -07:00
2006-09-28 18:02:30 -07:00
2006-03-20 22:21:10 -08:00
2006-06-21 12:40:49 -07:00
2006-07-31 15:44:29 -04:00
2006-06-05 12:29:17 -07:00
2006-10-11 11:14:15 -07:00
2006-09-26 08:48:47 -07:00
2006-03-22 07:53:57 -08:00
2006-10-11 11:14:19 -07:00
2006-09-28 18:02:22 -07:00
2006-09-29 09:18:12 -07:00
2006-10-01 00:39:19 -07:00
2006-06-25 10:01:13 -07:00
2006-03-23 07:38:14 -08:00
2006-03-23 07:38:14 -08:00
2006-09-22 14:54:20 -07:00
2006-09-28 18:02:58 -07:00
2006-03-20 13:44:40 -05:00
2006-08-27 11:01:32 -07:00
2006-10-02 07:57:22 -07:00
2006-09-26 08:48:48 -07:00
2006-10-04 07:55:30 -07:00
2006-03-27 08:44:48 -08:00
2006-08-19 17:44:31 -04:00
2006-10-03 08:03:40 -07:00
2006-05-04 06:55:12 +02:00
2006-06-28 15:54:27 -07:00
2006-09-25 21:08:37 -07:00
2006-07-03 19:48:25 -07:00
2006-10-03 23:01:26 +02:00
2006-10-02 07:57:15 -07:00
2006-06-23 07:42:49 -07:00
2006-06-25 10:01:06 -07:00
2006-06-25 10:01:06 -07:00
2006-09-26 08:49:04 -07:00
2005-11-07 07:53:46 -08:00
2006-09-26 08:48:44 -07:00
2006-06-25 10:01:14 -07:00
2006-09-29 09:18:11 -07:00
2006-03-23 07:38:12 -08:00
2005-10-30 17:37:32 -08:00
2005-11-07 07:53:37 -08:00
2006-10-10 16:15:34 -07:00
2006-10-01 00:39:18 -07:00
2006-10-01 00:39:19 -07:00
2006-09-26 08:48:58 -07:00
2006-10-11 11:14:21 -07:00
2005-10-30 17:37:32 -08:00
2006-10-06 08:53:40 -07:00
2006-03-31 12:18:56 -08:00
2006-01-12 14:06:38 -08:00
2006-09-28 17:53:59 -07:00
2006-01-10 08:01:59 -08:00
2006-09-27 08:26:20 -07:00
2006-03-23 07:38:14 -08:00
2006-09-28 18:02:16 -07:00
2006-10-10 16:15:34 -07:00
2006-10-01 00:39:34 -07:00
2006-10-01 00:39:19 -07:00
2006-10-04 07:55:12 -07:00
2006-09-29 09:18:13 -07:00
2006-07-10 13:24:25 -07:00
2006-09-25 16:52:14 -04:00
2006-10-03 23:01:26 +02:00
2006-10-09 14:20:38 -07:00
2006-10-04 00:31:09 -07:00