Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-28 20:01:19
Last Modify:2020-03-18 10:18:51 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:default_llseek

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

Type:loff_t

Parameter:

TypeParameterName
struct file *file
loff_toffset
intwhence
238  inode = file_inode(file)
241  inode_lock(inode)
243  Case whence == seek relative to end of file
244  offset += NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
245  Break
246  Case whence == seek relative to current file position
247  If offset == 0 Then
248  retval = f_pos
249  Go to out
251  offset += f_pos
252  Break
253  Case whence == seek to the next data
259  If offset >= i_size Then
260  retval = -ENXIO
261  Go to out
263  Break
264  Case whence == seek to the next hole
270  If offset >= i_size Then
271  retval = -ENXIO
272  Go to out
274  offset = i_size
275  Break
277  retval = -EINVAL
278  If offset >= 0 || unsigned_offsets(file) Then
279  If offset != f_pos Then
280  f_pos = offset
281  f_version = 0
283  retval = offset
285  out :
286  inode_unlock(inode)
287  Return retval