diff options
author | Vadim Lobanov <vlobanov@speakeasy.net> | 2006-03-28 01:56:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 09:16:04 -0800 |
commit | 68c3431ae22912be580c68d3955ef46515582943 (patch) | |
tree | e65917db1f37eca94d6cc11221d9b99b01e27f80 /fs | |
parent | e4a1f129f9e43a5e5d28fe6d1b214246a398cdce (diff) | |
download | linux-stable-68c3431ae22912be580c68d3955ef46515582943.tar.gz linux-stable-68c3431ae22912be580c68d3955ef46515582943.tar.bz2 linux-stable-68c3431ae22912be580c68d3955ef46515582943.zip |
[PATCH] Fold select_bits_alloc/free into caller code.
Remove an unnecessary level of indirection in allocating and freeing select
bits, as per the select_bits_alloc() and select_bits_free() functions.
Both select.c and compat.c are updated.
Signed-off-by: Vadim Lobanov <vlobanov@speakeasy.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/compat.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/compat.c b/fs/compat.c index ef5a0771592d..7f8e26ea427c 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1639,15 +1639,6 @@ void compat_set_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, * This is a virtual copy of sys_select from fs/select.c and probably * should be compared to it from time to time */ -static void *select_bits_alloc(int size) -{ - return kmalloc(6 * size, GFP_KERNEL); -} - -static void select_bits_free(void *bits, int size) -{ - kfree(bits); -} /* * We can actually return ERESTARTSYS instead of EINTR, but I'd @@ -1686,7 +1677,7 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp, */ ret = -ENOMEM; size = FDS_BYTES(n); - bits = select_bits_alloc(size); + bits = kmalloc(6 * size, GFP_KERNEL); if (!bits) goto out_nofds; fds.in = (unsigned long *) bits; @@ -1720,7 +1711,7 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp, compat_set_fd_set(n, exp, fds.res_ex); out: - select_bits_free(bits, size); + kfree(bits); out_nofds: return ret; } |