Commit 9d8fddfb authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

mm/allocpercpu.c: make 4 functions static

This patch makes the following needlessly global functions static:
 - percpu_depopulate()
 - __percpu_depopulate_mask()
 - percpu_populate()
 - __percpu_populate_mask()
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Acked-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9e5c6da7
...@@ -74,11 +74,6 @@ struct percpu_data { ...@@ -74,11 +74,6 @@ struct percpu_data {
(__typeof__(ptr))__p->ptrs[(cpu)]; \ (__typeof__(ptr))__p->ptrs[(cpu)]; \
}) })
extern void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu);
extern void percpu_depopulate(void *__pdata, int cpu);
extern int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
cpumask_t *mask);
extern void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask);
extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask); extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask);
extern void percpu_free(void *__pdata); extern void percpu_free(void *__pdata);
...@@ -86,26 +81,6 @@ extern void percpu_free(void *__pdata); ...@@ -86,26 +81,6 @@ extern void percpu_free(void *__pdata);
#define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) #define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
static inline void percpu_depopulate(void *__pdata, int cpu)
{
}
static inline void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
{
}
static inline void *percpu_populate(void *__pdata, size_t size, gfp_t gfp,
int cpu)
{
return percpu_ptr(__pdata, cpu);
}
static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
cpumask_t *mask)
{
return 0;
}
static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
{ {
return kzalloc(size, gfp); return kzalloc(size, gfp);
...@@ -118,10 +93,6 @@ static inline void percpu_free(void *__pdata) ...@@ -118,10 +93,6 @@ static inline void percpu_free(void *__pdata)
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#define percpu_populate_mask(__pdata, size, gfp, mask) \
__percpu_populate_mask((__pdata), (size), (gfp), &(mask))
#define percpu_depopulate_mask(__pdata, mask) \
__percpu_depopulate_mask((__pdata), &(mask))
#define percpu_alloc_mask(size, gfp, mask) \ #define percpu_alloc_mask(size, gfp, mask) \
__percpu_alloc_mask((size), (gfp), &(mask)) __percpu_alloc_mask((size), (gfp), &(mask))
......
...@@ -18,27 +18,28 @@ ...@@ -18,27 +18,28 @@
* Depopulating per-cpu data for a cpu going offline would be a typical * Depopulating per-cpu data for a cpu going offline would be a typical
* use case. You need to register a cpu hotplug handler for that purpose. * use case. You need to register a cpu hotplug handler for that purpose.
*/ */
void percpu_depopulate(void *__pdata, int cpu) static void percpu_depopulate(void *__pdata, int cpu)
{ {
struct percpu_data *pdata = __percpu_disguise(__pdata); struct percpu_data *pdata = __percpu_disguise(__pdata);
kfree(pdata->ptrs[cpu]); kfree(pdata->ptrs[cpu]);
pdata->ptrs[cpu] = NULL; pdata->ptrs[cpu] = NULL;
} }
EXPORT_SYMBOL_GPL(percpu_depopulate);
/** /**
* percpu_depopulate_mask - depopulate per-cpu data for some cpu's * percpu_depopulate_mask - depopulate per-cpu data for some cpu's
* @__pdata: per-cpu data to depopulate * @__pdata: per-cpu data to depopulate
* @mask: depopulate per-cpu data for cpu's selected through mask bits * @mask: depopulate per-cpu data for cpu's selected through mask bits
*/ */
void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) static void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
{ {
int cpu; int cpu;
for_each_cpu_mask_nr(cpu, *mask) for_each_cpu_mask_nr(cpu, *mask)
percpu_depopulate(__pdata, cpu); percpu_depopulate(__pdata, cpu);
} }
EXPORT_SYMBOL_GPL(__percpu_depopulate_mask);
#define percpu_depopulate_mask(__pdata, mask) \
__percpu_depopulate_mask((__pdata), &(mask))
/** /**
* percpu_populate - populate per-cpu data for given cpu * percpu_populate - populate per-cpu data for given cpu
...@@ -51,7 +52,7 @@ EXPORT_SYMBOL_GPL(__percpu_depopulate_mask); ...@@ -51,7 +52,7 @@ EXPORT_SYMBOL_GPL(__percpu_depopulate_mask);
* use case. You need to register a cpu hotplug handler for that purpose. * use case. You need to register a cpu hotplug handler for that purpose.
* Per-cpu object is populated with zeroed buffer. * Per-cpu object is populated with zeroed buffer.
*/ */
void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu) static void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu)
{ {
struct percpu_data *pdata = __percpu_disguise(__pdata); struct percpu_data *pdata = __percpu_disguise(__pdata);
int node = cpu_to_node(cpu); int node = cpu_to_node(cpu);
...@@ -68,7 +69,6 @@ void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu) ...@@ -68,7 +69,6 @@ void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu)
pdata->ptrs[cpu] = kzalloc(size, gfp); pdata->ptrs[cpu] = kzalloc(size, gfp);
return pdata->ptrs[cpu]; return pdata->ptrs[cpu];
} }
EXPORT_SYMBOL_GPL(percpu_populate);
/** /**
* percpu_populate_mask - populate per-cpu data for more cpu's * percpu_populate_mask - populate per-cpu data for more cpu's
...@@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(percpu_populate); ...@@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(percpu_populate);
* *
* Per-cpu objects are populated with zeroed buffers. * Per-cpu objects are populated with zeroed buffers.
*/ */
int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, static int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
cpumask_t *mask) cpumask_t *mask)
{ {
cpumask_t populated; cpumask_t populated;
...@@ -94,7 +94,9 @@ int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, ...@@ -94,7 +94,9 @@ int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
cpu_set(cpu, populated); cpu_set(cpu, populated);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(__percpu_populate_mask);
#define percpu_populate_mask(__pdata, size, gfp, mask) \
__percpu_populate_mask((__pdata), (size), (gfp), &(mask))
/** /**
* percpu_alloc_mask - initial setup of per-cpu data * percpu_alloc_mask - initial setup of per-cpu data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment