函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:撤销所有未偿还的文件

函数原型:int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)

返回类型:int

参数:

类型参数名称
struct inode *inode
unsigned intmode
unsigned inttype
1580  error等于0
1584  want_write等于mode按位与O_ACCMODE的值不等于O_RDONLY
1585  LIST_HEAD(dispose)
1587  new_fl等于Allocate a file_lock initialised to this type of lease
1588  如果是错误则返回:错误
1590  fl_flags等于type
1593  ctx等于smp_load_acquire( & i_flctx)
1594  如果非ctx
1595  WARN_ON_ONCE(1)
1596  转到:free_lock
1599  percpu_down_read( & file_rwsem)
1600  加自旋锁
1602  time_out_leases(inode, & dispose)
1604  如果非any_leases_conflict(inode, new_fl)则转到:out
1607  break_time等于0
1608  如果lease_break_time大于0则
1609  break_time等于jiffieslease_break_timeHZ
1610  如果break_time恒等于0则break_time自加
1615  如果非leases_conflict(fl, new_fl)则继续下一循环
1617  如果want_write
1618  如果fl_flags按位与Lease is being broken 则继续下一循环
1622  否则
1623  如果lease_breaking(fl)则继续下一循环
1628  如果lm_break(fl)则locks_delete_lock_ctx(fl, & dispose)
1632  如果链表为空则转到:out
1635  如果mode按位与O_NONBLOCK
1636  trace_break_lease_noblock(inode, new_fl)
1637  error等于负EWOULDBLOCK
1638  转到:out
1641  restart :
1642  fl等于list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.( & flc_lease, structfile_lock, fl_list)
1643  break_time等于 for lease breaks:
1644  如果break_time不等于0则break_time减等于jiffies
1646  如果break_time恒等于0则break_time自加
1648  Must be called with flc_lock held.
1649  trace_break_lease_block(inode, new_fl)
1650  自旋锁解锁
1651  percpu_up_read( & file_rwsem)
1653  locks_dispose_list( & dispose)
1654  error等于wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for*@timeout: timeout, in jiffies* The process is put to sleep (fl_wait, ! The lock, that is blocking us , break_time)
1657  percpu_down_read( & file_rwsem)
1658  加自旋锁
1659  trace_break_lease_unblock(inode, new_fl)
1660  locks_delete_lock - stop waiting for a file lock*@waiter: the lock which was waiting* lockd/nfsd need to disconnect the lock while working on it.
1661  如果error大于等于0则
1666  如果error恒等于0则time_out_leases(inode, & dispose)
1668  如果any_leases_conflict(inode, new_fl)则转到:restart
1670  error等于0
1672  out :
1673  自旋锁解锁
1674  percpu_up_read( & file_rwsem)
1675  locks_dispose_list( & dispose)
1676  free_lock :
1677  Free a lock which is not in use.
1678  返回:error
调用者
名称描述
break_lease
break_deleg
break_layout