Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lock_get_status

Proto:static void lock_get_status(struct seq_file *f, struct file_lock *fl, loff_t id, char *pfx)

Type:void

Parameter:

TypeParameterName
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  If (fl_file != NULL) Then inode = locks_inode(fl_file)
2810  seq_printf(f, "%lld:%s ", id, pfx)
2811  If IS_POSIX(fl) Then
2812  If fl_flags & trying to lock, just looking Then seq_puts(f, "ACCESS")
2814  Else if IS_OFDLCK(fl) Then seq_puts(f, "OFDLCK")
2816  Else seq_puts(f, "POSIX ")
2819  seq_printf(f, " %s ", (inode == NULL) ? "*NOINODE*" : mandatory_lock(inode) ? "MANDATORY" : "ADVISORY ")
2822  Else if IS_FLOCK(fl) Then
2823  If fl_type & LOCK_MAND Then
2824  seq_puts(f, "FLOCK MSNFS ")
2825  Else
2826  seq_puts(f, "FLOCK ADVISORY ")
2828  Else if IS_LEASE(fl) Then
2829  If fl_flags & NFSv4 delegation Then seq_puts(f, "DELEG ")
2831  Else seq_puts(f, "LEASE ")
2834  If lease_breaking(fl) Then seq_puts(f, "BREAKING ")
2836  Else if fl_file Then seq_puts(f, "ACTIVE ")
2838  Else seq_puts(f, "BREAKER ")
2840  Else
2841  seq_puts(f, "UNKNOWN UNKNOWN ")
2843  If fl_type & LOCK_MAND Then
2844  seq_printf(f, "%s ", (fl_type & LOCK_READ) ? (fl_type & LOCK_WRITE) ? "RW " : "READ " : (fl_type & LOCK_WRITE) ? "WRITE" : "NONE ")
2848  Else
2849  type = If IS_LEASE(fl) Then target_leasetype(fl) Else fl_type
2851  seq_printf(f, "%s ", (type == F_WRLCK) ? "WRITE" : (type == F_RDLCK) ? "READ" : "UNLCK")
2854  If inode Then
2856  seq_printf(f, "%d %02x:%02x:%lu ", fl_pid, MAJOR(s_dev), MINOR(s_dev), Stat data, not accessed from path walking )
2859  Else
2860  seq_printf(f, "%d <none>:0 ", fl_pid)
2862  If IS_POSIX(fl) Then
2863  If fl_end == OFFSET_MAX Then seq_printf(f, "%Ld EOF\n", fl_start)
2865  Else seq_printf(f, "%Ld %Ld\n", fl_start, fl_end)
2867  Else
2868  seq_puts(f, "0 EOF\n")
Caller
NameDescribe
locks_show
__show_fd_locks