函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:zpool_create_pool() - Create a new zpool*@type: The type of the zpool to create (e.g. zbud, zsmalloc)*@name: The name of the zpool (e.g. zram0, zswap)*@gfp: The GFP flags to use when allocating the pool.*@ops: The optional ops callback.

函数原型:struct zpool *zpool_create_pool(const char *type, const char *name, gfp_t gfp, const struct zpool_ops *ops)

返回类型:struct zpool

参数:

类型参数名称
const char *type
const char *name
gfp_tgfp
const struct zpool_ops *ops
161  pr_debug("creating pool type %s\n", type)
163  driver等于his assumes @type is null-terminated.
165  如果非driver
166  request_module("zpool-%s", type)
167  driver等于his assumes @type is null-terminated.
170  如果非driver
171  打印错误信息("no driver for type %s\n", type)
172  返回:NULL
175  zpool等于kmalloc(zpool的长度, gfp)
176  如果非zpool
177  打印错误信息("couldn't create zpool - out of memory\n")
178  zpool_put_driver(driver)
179  返回:NULL
182  driver等于driver
183  pool等于create(name, gfp, ops, zpool)
184  ops等于ops
185  evictable等于shrinkopsevict
187  如果非pool
188  打印错误信息("couldn't create %s pool\n", type)
189  zpool_put_driver(driver)
190  释放内存
191  返回:NULL
194  pr_debug("created pool type %s\n", type)
196  加自旋锁
197  添加链表项
198  自旋锁解锁
200  返回:zpool