Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / include / linux / ioprio.h
index 9e30ed6..e9bfe69 100644 (file)
@@ -70,6 +70,19 @@ static inline int task_nice_ioclass(struct task_struct *task)
                return IOPRIO_CLASS_BE;
 }
 
+/*
+ * If the calling process has set an I/O priority, use that. Otherwise, return
+ * the default I/O priority.
+ */
+static inline int get_current_ioprio(void)
+{
+       struct io_context *ioc = current->io_context;
+
+       if (ioc)
+               return ioc->ioprio;
+       return IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
+}
+
 /*
  * For inheritance, return the highest of the two given priorities
  */