Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:locks_get_lock_context

Proto:static struct file_lock_context *locks_get_lock_context(struct inode *inode, int type)

Type:struct file_lock_context

Parameter:

TypeParameterName
struct inode *inode
inttype
254  ctx = smp_load_acquire( & i_flctx)
255  If Value is more likely to compile time(ctx) || type == F_UNLCK Then Go to out
258  ctx = kmem_cache_alloc(flctx_cache, GFP_KERNEL)
259  If Not ctx Then Go to out
262  Process spin lock initialization( & flc_lock)
263  Initialization list head
264  Initialization list head
265  Initialization list head
271  If cmpxchg( & i_flctx, NULL, ctx) Then
272  kmem_cache_free(flctx_cache, ctx)
273  ctx = smp_load_acquire( & i_flctx)
275  out :
276  trace_locks_get_lock_context(inode, type, ctx)
277  Return ctx
Caller
NameDescribe
flock_lock_inodeTry to create a FLOCK lock on filp
posix_lock_inode
generic_add_lease