Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:struct zpool *zpool_create_pool(const char *type, const char *name, gfp_t gfp, const struct zpool_ops *ops)

Type:struct zpool

Parameter:

TypeParameterName
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  If Not driver Then
166  try to load a kernel module("zpool-%s", type)
167  driver = his assumes @type is null-terminated.
170  If Not driver Then
171  pr_err("no driver for type %s\n", type)
172  Return NULL
175  zpool = kmalloc( size of zpool , gfp)
176  If Not zpool Then
177  pr_err("couldn't create zpool - out of memory\n")
178  zpool_put_driver(driver)
179  Return NULL
182  driver = driver
183  pool = create(name, gfp, ops, zpool)
184  ops = ops
185  evictable = shrink && ops && evict
187  If Not pool Then
188  pr_err("couldn't create %s pool\n", type)
189  zpool_put_driver(driver)
190  kfree(zpool)
191  Return NULL
194  pr_debug("created pool type %s\n", type)
196  spin_lock( & pools_lock)
197  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
198  spin_unlock( & pools_lock)
200  Return zpool