kernel/include/linux/ioprio.h
.. .. @@ -71,6 +71,19 @@ 71 71 } 72 72 73 73 /* 74 + * If the calling process has set an I/O priority, use that. Otherwise, return75 + * 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 +/*74 87 * For inheritance, return the highest of the two given priorities 75 88 */ 76 89 extern int ioprio_best(unsigned short aprio, unsigned short bprio);