hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/ioprio.h
....@@ -71,6 +71,19 @@
7171 }
7272
7373 /*
74
+ * If the calling process has set an I/O priority, use that. Otherwise, return
75
+ * the default I/O priority.
76
+ */
77
+static inline int get_current_ioprio(void)
78
+{
79
+ struct io_context *ioc = current->io_context;
80
+
81
+ if (ioc)
82
+ return ioc->ioprio;
83
+ return IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
84
+}
85
+
86
+/*
7487 * For inheritance, return the highest of the two given priorities
7588 */
7689 extern int ioprio_best(unsigned short aprio, unsigned short bprio);