Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:val must be a null-terminated string

Proto:static int __zswap_param_set(const char *val, const struct kernel_param *kp, char *type, char *compressor)

Type:int

Parameter:

TypeParameterName
const char *val
const struct kernel_param *kp
char *type
char *compressor
669  struct zswap_pool * pool, * put_pool = NULL
670  s = strstrip((char * )val)
673  If atal error during init Then
674  pr_err("can't set param, initialization failed\n")
675  Return -ENODEV
679  If Not strcmp(s, * (char * * )arg) && it completed, but couldn't create the initial pool Then Return 0
685  If Not used by param callback function Then Return param_set_charp(s, kp)
688  If Not type Then
689  If Not zpool_has_pool(s) Then
690  pr_err("zpool %s not available\n", s)
691  Return -ENOENT
693  type = s
694  Else if Not compressor Then
695  If Not crypto_has_comp(s, 0, 0) Then
696  pr_err("compressor %s not available\n", s)
697  Return -ENOENT
699  compressor = s
700  Else
701  WARN_ON(1)
702  Return -EINVAL
705  spin_lock( & protects zswap_pools list modification )
707  pool = ype and compressor must be null-terminated
708  If pool Then
709  helpers and fwd declarations("using existing", pool)
710  WARN_ON(pool == zswap_pool_current())
711  list_del_rcu - deletes entry from list without re-initialization*@entry: the element to delete from the list
714  spin_unlock( & protects zswap_pools list modification )
716  If Not pool Then pool = zswap_pool_create(type, compressor)
719  If pool Then ret = param_set_charp(s, kp)
721  Else ret = -EINVAL
724  spin_lock( & protects zswap_pools list modification )
726  If Not ret Then
727  put_pool = zswap_pool_current()
728  list_add_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head
729  it completed, but couldn't create the initial pool = true
730  Else if pool Then
735  list_add_tail_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head
736  put_pool = pool
739  spin_unlock( & protects zswap_pools list modification )
741  If Not it completed, but couldn't create the initial pool && Not pool Then
749  ret = param_set_charp(s, kp)
755  If put_pool Then zswap_pool_put(put_pool)
758  Return ret
Caller
NameDescribe
zswap_compressor_param_set
zswap_zpool_param_set