函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lock_get_status

函数原型:static void lock_get_status(struct seq_file *f, struct file_lock *fl, loff_t id, char *pfx)

返回类型:void

参数:

类型参数名称
struct seq_file *f
struct file_lock *fl
loff_tid
char *pfx
2796  struct inode * inode = NULL
2798  proc_pidns等于s_fs_info
2800  fl_pid等于locks_translate_pid - translate a file_lock's fl_pid number into a namespace*@fl: The file_lock who's fl_pid should be translated*@ns: The namespace into which the pid should be translated* Used to tranlate a fl_pid into a namespace virtual pid number
2807  如果(fl_file != NULL)则inode等于locks_inode(fl_file)
2810  seq_printf(f, "%lld:%s ", id, pfx)
2811  如果IS_POSIX(fl)则
2812  如果fl_flags按位与 trying to lock, just looking seq_puts(f, "ACCESS")
2814  否则如果IS_OFDLCK(fl)则seq_puts(f, "OFDLCK")
2816  否则seq_puts(f, "POSIX ")
2819  seq_printf(f, " %s ", (inode == NULL) ? "*NOINODE*" : mandatory_lock(inode) ? "MANDATORY" : "ADVISORY ")
2822  否则如果IS_FLOCK(fl)则
2823  如果fl_type按位与LOCK_MAND
2824  seq_puts(f, "FLOCK MSNFS ")
2825  否则
2826  seq_puts(f, "FLOCK ADVISORY ")
2828  否则如果IS_LEASE(fl)则
2829  如果fl_flags按位与NFSv4 delegation seq_puts(f, "DELEG ")
2831  否则seq_puts(f, "LEASE ")
2834  如果lease_breaking(fl)则seq_puts(f, "BREAKING ")
2836  否则如果fl_fileseq_puts(f, "ACTIVE ")
2838  否则seq_puts(f, "BREAKER ")
2840  否则
2841  seq_puts(f, "UNKNOWN UNKNOWN ")
2843  如果fl_type按位与LOCK_MAND
2844  seq_printf(f, "%s ", (fl_type & LOCK_READ) ? (fl_type & LOCK_WRITE) ? "RW " : "READ " : (fl_type & LOCK_WRITE) ? "WRITE" : "NONE ")
2848  否则
2849  type等于如果IS_LEASE(fl)则target_leasetype(fl)否则fl_type
2851  seq_printf(f, "%s ", (type == F_WRLCK) ? "WRITE" : (type == F_RDLCK) ? "READ" : "UNLCK")
2854  如果inode
2856  seq_printf(f, "%d %02x:%02x:%lu ", fl_pid, MAJOR(s_dev), MINOR(s_dev), Stat data, not accessed from path walking )
2859  否则
2860  seq_printf(f, "%d <none>:0 ", fl_pid)
2862  如果IS_POSIX(fl)则
2863  如果fl_end恒等于OFFSET_MAXseq_printf(f, "%Ld EOF\n", fl_start)
2865  否则seq_printf(f, "%Ld %Ld\n", fl_start, fl_end)
2867  否则
2868  seq_puts(f, "0 EOF\n")
调用者
名称描述
locks_show
__show_fd_locks