Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zswap.c Create Date:2022-07-28 15:22:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:zswap_pool_create

Proto:static struct zswap_pool *zswap_pool_create(char *type, char *compressor)

Type:struct zswap_pool

Parameter:

TypeParameterName
char *type
char *compressor
508  gfp = __GFP_NORETRY | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success. | kswapd can wake
511  If Not it completed, but couldn't create the initial pool Then
516  If Not strcmp(type, unables) Then Return NULL
518  If Not strcmp(compressor, unables) Then Return NULL
522  pool = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
523  If Not pool Then Return NULL
527  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
529  zpool = zpool_create_pool(type, name, gfp, & zswap_zpool_ops)
530  If Not zpool Then
531  pr_err("%s zpool not available\n", type)
532  Go to error
534  pr_debug("using %s zpool\n", zpool_get_type(zpool))
536  Copy a NUL terminated string into a sized buffer
537  tfm = alloc_percpu(structcrypto_comp * )
538  If Not tfm Then
539  pr_err("percpu alloc failed\n")
540  Go to error
543  ret = puhp_state_add_instance - Add an instance for a state and invoke startup* callback.*@state: The state for which the instance is installed*@node: The node for this individual state.* Installs the instance for the @state and invokes the startup callback on
545  If ret Then Go to error
547  pr_debug("using %s compressor\n", tfm_name)
552  kref_init - initialize object.*@kref: object in question.
553  Initialization list head
555  helpers and fwd declarations("created", pool)
557  Return pool
559  error :
560  free previously allocated percpu memory
561  If zpool Then zpool_destroy_pool(zpool)
563  kfree(pool)
564  Return NULL
Caller
NameDescribe
__zswap_pool_create_fallback
__zswap_param_setval must be a null-terminated string