Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq-debugfs.c Create Date:2022-07-28 18:07:58
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:queue_state_write

Proto:static ssize_t queue_state_write(void *data, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
void *data
const char __user *buf
size_tcount
loff_t *ppos
144  q = data
145  char opbuf[16] = {}, * op
152  If blk_queue_dead(q) Then Return -ENOENT
155  If count >= size of opbuf Then
156  pr_err("%s: operation too long\n", __func__)
157  Go to inval
160  If copy_from_user(opbuf, buf, count) Then Return -EFAULT
162  op = strstrip(opbuf)
163  If strcmp(op, "run") == 0 Then
164  blk_mq_run_hw_queues(q, true)
165  Else if strcmp(op, "start") == 0 Then
166  blk_mq_start_stopped_hw_queues(q, true)
167  Else if strcmp(op, "kick") == 0 Then
168  blk_mq_kick_requeue_list(q)
169  Else
170  pr_err("%s: unsupported operation '%s'\n", __func__, op)
171  inval :
172  pr_err("%s: use 'run', 'start' or 'kick'\n", __func__)
173  Return -EINVAL
175  Return count