Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dcache.c Create Date:2022-07-28 20:07:28
Last Modify:2020-03-18 10:27:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)

Type:struct dentry

Parameter:

TypeParameterName
struct super_block *sb
const struct qstr *name
1690  dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL)
1691  If Not dentry Then Return NULL
1700  small names [128 bytes - 1] = 0
1701  If Value for the false possibility is greater at compile time(!name) Then
1702  name = slash_name
1703  dname = small names
1704  Else if len > 128 bytes - 1 Then
1705  size = offsetof(structexternal_name, name[1])
1706  p = Allocation memory
1709  If Not p Then
1711  Return NULL
1713  atomic_set( & count, 1)
1714  dname = name
1715  Else
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  Process spin lock initialization( & 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  Initialization list head
1738  Initialization list head
1739  INIT_HLIST_NODE( & de alias list )
1740  Initialization list head
1741  d_set_d_op(dentry, s_d_op)
1743  If d_op && d_init Then
1744  err = d_init(dentry)
1745  If err Then
1749  Return NULL
1753  this_cpu_inc(nr_dentry)
1755  Return dentry
Caller
NameDescribe
d_alloc allocate a dcache entry
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.