| Function report | 
| 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 activity | Download SCCT | Chinese | 
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:
| Type | Parameter | Name | 
|---|---|---|
| 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 | 
| 1705 | size = offsetof(structexternal_name, name[1]) | 
| 1706 | p = Allocation memory | 
| 1709 | If Not p Then | 
| 1710 | kmem_cache_free(dentry_cache, dentry) | 
| 1711 | Return NULL | 
| 1713 | atomic_set( & count, 1) | 
| 1715 | Else | 
| 1716 | dname = small names | 
| 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 ) | 
| 1739 | INIT_HLIST_NODE( & de alias list ) | 
| 1741 | d_set_d_op(dentry, s_d_op) | 
| 1745 | If err Then | 
| 1746 | If dname_external(dentry) Then kfree(external_name(dentry)) | 
| 1748 | kmem_cache_free(dentry_cache, dentry) | 
| 1749 | Return NULL | 
| 1753 | this_cpu_inc(nr_dentry) | 
| 1755 | Return dentry | 
| Name | Describe | 
|---|---|
| d_alloc | allocate a dcache entry | 
| d_alloc_anon | |
| d_alloc_pseudo | d_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. | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |