函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dcache.c Create Date:2022-07-29 10:37:31
Last Modify:2020-03-18 10:27:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__d_alloc - allocate a dcache entry*@sb: filesystem it will belong to*@name: qstr of the name* Allocates a dentry. It returns %NULL if there is insufficient memory* available. On a success the dentry is returned. The name passed in is

函数原型:static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)

返回类型:struct dentry

参数:

类型参数名称
struct super_block *sb
const struct qstr *name
1690  dentry等于分配高速缓存区
1691  如果非dentry则返回:NULL
1700  small names [128 bytes - 1]等于0
1701  如果此条件成立可能性小(为编译器优化)(!name)则
1702  name等于slash_name
1703  dname等于 small names
1704  否则如果len大于128 bytes 减1则
1705  size等于offsetof(structexternal_name, name[1])
1706  p等于开辟内存
1709  如果非p
1711  返回:NULL
1713  atomic_set( & count, 1)
1714  dname等于name
1715  否则
1716  dname等于 small names
1719  len等于len
1720  hash等于hash
1721  memcpy(dname, name, len)
1722  dname[len]等于0
1725  smp_store_release( & name, dname)
1727  count等于1
1728  protected by d_lock 等于0
1729  spin_lock_init( & d_lock)
1730  seqcount_init( & per dentry seqlock )
1731  Where the name belongs to - NULL is * negative = NULL
1732  parent directory 等于dentry
1733  The root of the dentry tree 等于sb
1734  d_op = NULL
1735  fs-specific data = NULL
1736  INIT_HLIST_BL_NODE( & lookup hash list )
1737  初始化链表头
1738  初始化链表头
1739  INIT_HLIST_NODE( & de alias list )
1740  初始化链表头
1741  d_set_d_op(dentry, s_d_op)
1743  如果d_opd_init
1744  err等于d_init(dentry)
1745  如果err
1749  返回:NULL
1753  this_cpu_inc(nr_dentry)
1755  返回:dentry
调用者
名称描述
d_alloc分配高速缓存区
d_alloc_anon
d_alloc_pseudod_alloc_pseudo - allocate a dentry (for lookup-less filesystems)*@sb: the superblock*@name: qstr of the name* For a filesystem that just pins its dentries in memory and never* performs lookups at all, return an unhashed IS_ROOT dentry.