函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zswap.c Create Date:2022-07-27 16:53:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:val must be a null-terminated string

函数原型:static int __zswap_param_set(const char *val, const struct kernel_param *kp, char *type, char *compressor)

返回类型:int

参数:

类型参数名称
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  如果atal error during init
674  打印错误信息("can't set param, initialization failed\n")
675  返回:负ENODEV
679  如果非字符串比较it completed, but couldn't create the initial pool 则返回:0
685  如果非used by param callback function 则返回:param_set_charp(s, kp)
688  如果非type
689  如果非zpool_has_pool(s)则
690  打印错误信息("zpool %s not available\n", s)
691  返回:负ENOENT
693  type等于s
694  否则如果非compressor
695  如果非crypto_has_comp(s, 0, 0)则
696  打印错误信息("compressor %s not available\n", s)
697  返回:负ENOENT
699  compressor等于s
700  否则
701  WARN_ON(1)
702  返回:负EINVAL
705  加自旋锁
707  pool等于ype and compressor must be null-terminated
708  如果pool
709  helpers and fwd declarations("using existing", pool)
710  WARN_ON(pool == zswap_pool_current())
711  删除不需要重新初始化的列表项
714  自旋锁解锁
716  如果非poolpool等于zswap_pool_create(type, compressor)
719  如果poolret等于param_set_charp(s, kp)
721  否则ret等于负EINVAL
724  加自旋锁
726  如果非ret
727  put_pool等于zswap_pool_current()
728  添加RCU保护项
729  it completed, but couldn't create the initial pool = true
730  否则如果pool
735  添加RCU链表项
736  put_pool等于pool
739  自旋锁解锁
741  如果非it completed, but couldn't create the initial pool 且非pool
749  ret等于param_set_charp(s, kp)
755  如果put_poolzswap_pool_put(put_pool)
758  返回:ret
调用者
名称描述
zswap_compressor_param_set
zswap_zpool_param_set