[PATCH] disk quotas fail when /etc/mtab is symlinked to /proc/mounts
[safe/jmp/linux-2.6] / include / linux / bio.h
index 0380227..69e0479 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <linux/highmem.h>
 #include <linux/mempool.h>
+#include <linux/ioprio.h>
 
 /* Platforms may set this to teach the BIO layer about IOMMU hardware. */
 #include <asm/io.h>
@@ -110,7 +111,6 @@ struct bio {
        void                    *bi_private;
 
        bio_destructor_t        *bi_destructor; /* destructor */
-       struct bio_set          *bi_set;        /* memory pools set */
 };
 
 /*
@@ -150,6 +150,19 @@ struct bio {
 #define BIO_RW_SYNC    4
 
 /*
+ * upper 16 bits of bi_rw define the io priority of this bio
+ */
+#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
+#define bio_prio(bio)  ((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio_valid(bio)    ioprio_valid(bio_prio(bio))
+
+#define bio_set_prio(bio, prio)                do {                    \
+       WARN_ON(prio >= (1 << IOPRIO_BITS));                    \
+       (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);          \
+       (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);     \
+} while (0)
+
+/*
  * various member access, note that bio_data should of course not be used
  * on highmem page vectors
  */
@@ -266,6 +279,7 @@ extern void bioset_free(struct bio_set *);
 extern struct bio *bio_alloc(unsigned int __nocast, int);
 extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *);
 extern void bio_put(struct bio *);
+extern void bio_free(struct bio *, struct bio_set *);
 
 extern void bio_endio(struct bio *, unsigned int, int);
 struct request_queue;