padata: Rename padata_alloc functions
We rename padata_alloc to padata_alloc_possible because this function allocates a padata_instance and uses the cpu_possible mask for parallel and serial workers. Also we rename __padata_alloc to padata_alloc to avoid to export underlined functions. Underlined functions are considered to be private to padata. Users are updated accordingly. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
cc74f4bc11
commit
e6cc117076
3 changed files with 18 additions and 17 deletions
|
@ -457,7 +457,7 @@ static int __pcrypt_init_instance(struct pcrypt_instance *pcrypt,
|
||||||
if (!pcrypt->wq)
|
if (!pcrypt->wq)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
pcrypt->pinst = padata_alloc(pcrypt->wq);
|
pcrypt->pinst = padata_alloc_possible(pcrypt->wq);
|
||||||
if (!pcrypt->pinst)
|
if (!pcrypt->pinst)
|
||||||
goto err_destroy_workqueue;
|
goto err_destroy_workqueue;
|
||||||
|
|
||||||
|
|
|
@ -165,10 +165,11 @@ struct padata_instance {
|
||||||
#define PADATA_INVALID 4
|
#define PADATA_INVALID 4
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct padata_instance *padata_alloc(struct workqueue_struct *wq);
|
extern struct padata_instance *padata_alloc_possible(
|
||||||
extern struct padata_instance *__padata_alloc(struct workqueue_struct *wq,
|
struct workqueue_struct *wq);
|
||||||
const struct cpumask *pcpumask,
|
extern struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
||||||
const struct cpumask *cbcpumask);
|
const struct cpumask *pcpumask,
|
||||||
|
const struct cpumask *cbcpumask);
|
||||||
extern void padata_free(struct padata_instance *pinst);
|
extern void padata_free(struct padata_instance *pinst);
|
||||||
extern int padata_do_parallel(struct padata_instance *pinst,
|
extern int padata_do_parallel(struct padata_instance *pinst,
|
||||||
struct padata_priv *padata, int cb_cpu);
|
struct padata_priv *padata, int cb_cpu);
|
||||||
|
|
|
@ -1060,29 +1060,29 @@ static struct kobj_type padata_attr_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* padata_alloc - Allocate and initialize padata instance.
|
* padata_alloc_possible - Allocate and initialize padata instance.
|
||||||
* Use default cpumask(cpu_possible_mask)
|
* Use the cpu_possible_mask for serial and
|
||||||
* for serial and parallel workes.
|
* parallel workers.
|
||||||
*
|
*
|
||||||
* @wq: workqueue to use for the allocated padata instance
|
* @wq: workqueue to use for the allocated padata instance
|
||||||
*/
|
*/
|
||||||
struct padata_instance *padata_alloc(struct workqueue_struct *wq)
|
struct padata_instance *padata_alloc_possible(struct workqueue_struct *wq)
|
||||||
{
|
{
|
||||||
return __padata_alloc(wq, cpu_possible_mask, cpu_possible_mask);
|
return padata_alloc(wq, cpu_possible_mask, cpu_possible_mask);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(padata_alloc);
|
EXPORT_SYMBOL(padata_alloc_possible);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __padata_alloc - allocate and initialize a padata instance
|
* padata_alloc - allocate and initialize a padata instance and specify
|
||||||
* and specify cpumasks for serial and parallel workers.
|
* cpumasks for serial and parallel workers.
|
||||||
*
|
*
|
||||||
* @wq: workqueue to use for the allocated padata instance
|
* @wq: workqueue to use for the allocated padata instance
|
||||||
* @pcpumask: cpumask that will be used for padata parallelization
|
* @pcpumask: cpumask that will be used for padata parallelization
|
||||||
* @cbcpumask: cpumask that will be used for padata serialization
|
* @cbcpumask: cpumask that will be used for padata serialization
|
||||||
*/
|
*/
|
||||||
struct padata_instance *__padata_alloc(struct workqueue_struct *wq,
|
struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
||||||
const struct cpumask *pcpumask,
|
const struct cpumask *pcpumask,
|
||||||
const struct cpumask *cbcpumask)
|
const struct cpumask *cbcpumask)
|
||||||
{
|
{
|
||||||
struct padata_instance *pinst;
|
struct padata_instance *pinst;
|
||||||
struct parallel_data *pd = NULL;
|
struct parallel_data *pd = NULL;
|
||||||
|
@ -1138,7 +1138,7 @@ struct padata_instance *__padata_alloc(struct workqueue_struct *wq,
|
||||||
err:
|
err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(__padata_alloc);
|
EXPORT_SYMBOL(padata_alloc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* padata_free - free a padata instance
|
* padata_free - free a padata instance
|
||||||
|
|
Loading…
Add table
Reference in a new issue