Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:seq_lseek - ->llseek() method for sequential files.*@file: the file in question*@offset: new position*@whence: 0 for absolute, 1 for relative position* Ready-made ->f_op->llseek()

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

Type:loff_t

Parameter:

TypeParameterName
struct file *file
loff_toffset
intwhence
312  m = needed for tty driver, and maybe others
313  retval = -EINVAL
315  mutex_lock( & lock)
316  version = f_version
318  Case whence == seek relative to current file position
319  offset += f_pos
321  Case whence == seek relative to beginning of file
322  If offset < 0 Then Break
324  retval = offset
325  If offset != read_pos Then
326  When (retval = traverse(m, offset)) == -EAGAIN cycle
328  If retval Then
330  f_pos = 0
331  read_pos = 0
332  version = 0
333  index = 0
334  count = 0
335  Else
336  read_pos = offset
337  retval = f_pos = offset
339  Else
340  f_pos = offset
343  f_version = version
344  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
345  Return retval
Caller
NameDescribe
tracing_lseek