blk-sysfs.c
Includes Linux kernel module headerAssigns a negative errno constant
SHA-25691a7d7c6d01966f937a469351dab775921ce4679b1c8da03cb9c44441198e430
MaleculeO(Er)H(Os)
Evidence
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to sysfs handling
4 */
5#include <linux/kernel.h>
6#include <linux/slab.h>
7#include <linux/module.h>
8#include <linux/bio.h>
9#include <linux/blkdev.h>
10#include <linux/backing-dev.h>
11#include <linux/blktrace_api.h>
12#include <linux/debugfs.h>
13
14#include "blk.h"
15#include "blk-mq.h"
16#include "blk-mq-debugfs.h"
17#include "blk-mq-sched.h"
18#include "blk-rq-qos.h"
19#include "blk-wbt.h"
20#include "blk-cgroup.h"
21#include "blk-throttle.h"
22
23struct queue_sysfs_entry {
24 struct attribute attr;
25 ssize_t (*show)(struct gendisk *disk, ch …
43:15… v;
44
45 err = kstrtoul(page, 10, &v);
46 if (err || v > UINT_MAX)
47 return -EINVAL;
48
49 *var = v;
⋯9 lines
76:7… rn ret;
77
78 /*
79 * Serialize updating nr_requests with concurrent queue_requests_store()
80 * and switching elevator.
81 *
82 * Use trylock to avoid circular lock dependency with kernfs active
83 …
84:69… el)
85 * kn->active -> update_nr_hwq_lock (via this sysfs write path)
86 */
87 if (!down_write_trylock(&set->update_nr_hwq_lock))
88 return -EBUSY;
89
90 i …
103:28… AX_SCHED_RQ) ||
104 (!q->elevator && nr > set->queue_depth)) {
105 ret = -EINVAL;
106 goto unlock;
107 }
⋯5 lines