Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dcache_dir_lseek

Proto:loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)

Type:loff_t

Parameter:

TypeParameterName
struct file *file
loff_toffset
intwhence
135  dentry = dentry
137  Case whence == 1
138  offset += f_pos
140  Case whence == 0
141  If offset >= 0 Then Break
144  Default
145  Return -EINVAL
147  If offset != f_pos Then
148  cursor = needed for tty driver, and maybe others
149  struct dentry * to = NULL
151  inode_lock_shared( Where the name belongs to - NULL is * negative )
153  If offset > 2 Then to = Returns an element of siblings' list.* We are looking for th positive after

; if* found, dentry is grabbed and returned to caller.* If no such element exists, NULL is returned.

156  spin_lock( & d_lock)
157  If to Then list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
159  Else list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
161  spin_unlock( & d_lock)
162  dput - release a dentry*@dentry: dentry to release * Release a dentry. This will drop the usage count and if appropriate* call the dentry unlink method as well as removing it from the queues and* releasing its resources
164  f_pos = offset
166  inode_unlock_shared( Where the name belongs to - NULL is * negative )
168  Return offset