函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:generic_add_lease

函数原型:static int generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv)

返回类型:int

参数:

类型参数名称
struct file *filp
longarg
struct file_lock **flp
void **priv
1808  my_fl等于NULL
1809  inode等于locks_inode(filp)
1811  is_deleg等于fl_flags按位与NFSv4 delegation
1813  LIST_HEAD(dispose)
1815  lease等于flp
1816  trace_generic_add_lease(inode, lease)
1819  ctx等于locks_get_lock_context(inode, arg)
1820  如果非ctx则返回:负ENOMEM
1831  如果is_deleg且非inode_trylock(inode)则返回:负EAGAIN
1834  如果is_delegarg恒等于F_WRLCK
1836  inode_unlock(inode)
1837  WARN_ON_ONCE(1)
1838  返回:负EINVAL
1841  percpu_down_read( & file_rwsem)
1842  加自旋锁
1843  time_out_leases(inode, & dispose)
1844  error等于heck_conflicting_open - see if the given file points to an inode that has* an existing open that would conflict with the* desired lease
1845  如果error则转到:out
1856  error等于负EAGAIN
1858  如果fl_file恒等于filpfl_owner恒等于fl_owner
1860  my_fl等于fl
1861  继续下一循环
1868  如果arg恒等于F_WRLCK则转到:out
1874  如果fl_flags按位与Lease is being broken 则转到:out
1878  如果(my_fl != NULL)则
1879  lease等于my_fl
1880  error等于lm_change(lease, arg, & dispose)
1881  如果error则转到:out
1883  转到:out_setup
1886  error等于负EINVAL
1887  如果非leases_enable则转到:out
1890  locks_insert_lock_ctx(lease, & flc_lease)
1900  smp_mb()
1901  error等于heck_conflicting_open - see if the given file points to an inode that has* an existing open that would conflict with the* desired lease
1902  如果error
1903  locks_unlink_lock_ctx(lease)
1904  转到:out
1907  out_setup :
1908  如果lm_setuplm_setup(lease, priv)
1910  out :
1911  自旋锁解锁
1912  percpu_up_read( & file_rwsem)
1913  locks_dispose_list( & dispose)
1914  如果is_deleginode_unlock(inode)
1916  如果非error且非my_fl则 * flp = NULL
1918  返回:error
调用者
名称描述
generic_setleasegeneric_setlease - sets a lease on an open file*@filp: file pointer*@arg: type of lease to obtain*@flp: input - file_lock to use, output - file_lock inserted*@priv: private data for lm_setup (may be NULL if lm_setup* doesn't require it)* The (input)