Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__do_proc_dointvec

Proto:static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos, int (*conv)(bool *negp, unsigned long *lvalp, int *valp, int write, void *data), void *data)

Type:int

Parameter:

TypeParameterName
void *tbl_data
struct ctl_table *table
intwrite
void __user *buffer
size_t *lenp
loff_t *ppos
int (*conv
void *data
2340  first = 1 , err = 0
2342  kbuf = NULL
2344  If Not tbl_data || Not maxlen || Not lenp || ppos && Not write Then
2345  lenp = 0
2346  Return 0
2349  i = tbl_data
2350  vleft = maxlen / size of i
2351  left = lenp
2353  If Not conv Then conv = do_proc_dointvec_conv
2356  If write Then
2357  If proc_first_pos_non_zero_ignore - check if first position is allowed*@ppos: file position*@table: the sysctl table* Returns true if the first position is non-zero and the sysctl_writes_strict* mode indicates this is not allowed for numeric input types Then Go to out
2360  If left > PAGE_SIZE - 1 Then left = PAGE_SIZE - 1
2362  p = kbuf = memdup_user_nul(buffer, left)
2363  If IS_ERR(kbuf) Then Return PTR_ERR(kbuf)
2367  When left && vleft-- cycle
2371  If write Then
2372  left -= proc_skip_spaces( & p)
2374  If Not left Then Break
2379  If err Then Break
2381  If conv( & neg, & lval, i, 1, data) Then
2382  err = -EINVAL
2383  Break
2385  Else
2386  If conv( & neg, & lval, i, 0, data) Then
2387  err = -EINVAL
2388  Break
2390  If Not first Then err = proc_put_char( & buffer, & left, '\t')
2392  If err Then Break
2395  If err Then Break
2400  If Not write && Not first && left && Not err Then err = proc_put_char( & buffer, & left, '\n')
2402  If write && Not err && left Then left -= proc_skip_spaces( & p)
2404  If write Then
2405  free previously allocated memory
2406  If first Then Return If err Else -EINVAL
2409  lenp -= left
2410  out :
2411  ppos += lenp
2412  Return err
Caller
NameDescribe
do_proc_dointvec
proc_do_cad_pid