Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16824
b: refs/heads/master
c: f9f7500
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg authored and Linus Torvalds committed Jan 9, 2006
1 parent d55dfaa commit c4a9f0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b792de39d892e06b18ddea85be076bae123d6bf6
refs/heads/master: f9f7500521b25dbf1aba476b81230489ad8e2c4b
7 changes: 3 additions & 4 deletions trunk/include/linux/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ struct percpu_data {
(__typeof__(ptr))__p->ptrs[(cpu)]; \
})

extern void *__alloc_percpu(size_t size, size_t align);
extern void *__alloc_percpu(size_t size);
extern void free_percpu(const void *);

#else /* CONFIG_SMP */

#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })

static inline void *__alloc_percpu(size_t size, size_t align)
static inline void *__alloc_percpu(size_t size)
{
void *ret = kmalloc(size, GFP_KERNEL);
if (ret)
Expand All @@ -55,7 +55,6 @@ static inline void free_percpu(const void *ptr)
#endif /* CONFIG_SMP */

/* Simple wrapper for the common case: zeros memory. */
#define alloc_percpu(type) \
((type *)(__alloc_percpu(sizeof(type), __alignof__(type))))
#define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type))))

#endif /* __LINUX_PERCPU_H */
3 changes: 1 addition & 2 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2944,9 +2944,8 @@ EXPORT_SYMBOL(__kmalloc);
* Objects should be dereferenced using the per_cpu_ptr macro only.
*
* @size: how many bytes of memory are required.
* @align: the alignment, which can't be greater than SMP_CACHE_BYTES.
*/
void *__alloc_percpu(size_t size, size_t align)
void *__alloc_percpu(size_t size)
{
int i;
struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,11 @@ snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign)
if (ptr == NULL)
return -EINVAL;

ptr[0] = __alloc_percpu(mibsize, mibalign);
ptr[0] = __alloc_percpu(mibsize);
if (!ptr[0])
goto err0;

ptr[1] = __alloc_percpu(mibsize, mibalign);
ptr[1] = __alloc_percpu(mibsize);
if (!ptr[1])
goto err1;

Expand Down

0 comments on commit c4a9f0f

Please sign in to comment.