Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:fcntl_rw_hint

Proto:static long fcntl_rw_hint(struct file *file, unsigned int cmd, unsigned long arg)

Type:long

Parameter:

TypeParameterName
struct file *file
unsigned intcmd
unsigned longarg
279  inode = file_inode(file)
280  __user * argp = arg
285  Case cmd == F_GET_FILE_RW_HINT
286  h = file_write_hint(file)
287  If copy_to_user(argp, & h, size of argp ) Then Return -EFAULT
289  Return 0
290  Case cmd == F_SET_FILE_RW_HINT
291  If copy_from_user( & h, argp, size of h ) Then Return -EFAULT
293  hint = h
294  If Not rw_hint_valid(hint) Then Return -EINVAL
297  spin_lock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
298  f_write_hint = hint
299  spin_unlock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
300  Return 0
301  Case cmd == Set/Get write life time hints. {GET,SET}_RW_HINT operate on the* underlying inode, while {GET,SET}_FILE_RW_HINT operate only on* the specific file.
302  h = i_write_hint
303  If copy_to_user(argp, & h, size of argp ) Then Return -EFAULT
305  Return 0
306  Case cmd == F_SET_RW_HINT
307  If copy_from_user( & h, argp, size of h ) Then Return -EFAULT
309  hint = h
310  If Not rw_hint_valid(hint) Then Return -EINVAL
313  inode_lock(inode)
314  i_write_hint = hint
315  inode_unlock(inode)
316  Return 0
317  Default
318  Return -EINVAL
Caller
NameDescribe
do_fcntl