[PATCH] Kill PF_SYNCWRITE flag
[linux-block.git] / include / linux / blkdev.h
index c179966f1a2fea92faa912ffbf8133478ee9b30d..482a21d676279ccbd3d7421be1630b009db44094 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _LINUX_BLKDEV_H
 #define _LINUX_BLKDEV_H
 
-#include <linux/config.h>
 #include <linux/major.h>
 #include <linux/genhd.h>
 #include <linux/list.h>
@@ -17,6 +16,8 @@
 
 #include <asm/scatterlist.h>
 
+struct scsi_ioctl_command;
+
 struct request_queue;
 typedef struct request_queue request_queue_t;
 struct elevator_queue;
@@ -55,25 +56,29 @@ struct as_io_context {
 
 struct cfq_queue;
 struct cfq_io_context {
-       /*
-        * circular list of cfq_io_contexts belonging to a process io context
-        */
-       struct list_head list;
-       struct cfq_queue *cfqq[2];
+       struct rb_node rb_node;
        void *key;
 
+       struct cfq_queue *cfqq[2];
+
        struct io_context *ioc;
 
        unsigned long last_end_request;
-       unsigned long last_queue;
+       sector_t last_request_pos;
+       unsigned long last_queue;
+
        unsigned long ttime_total;
        unsigned long ttime_samples;
        unsigned long ttime_mean;
 
+       unsigned int seek_samples;
+       u64 seek_total;
+       sector_t seek_mean;
+
        struct list_head queue_list;
 
-       void (*dtor)(struct cfq_io_context *);
-       void (*exit)(struct cfq_io_context *);
+       void (*dtor)(struct io_context *); /* destructor */
+       void (*exit)(struct io_context *); /* called on task exit */
 };
 
 /*
@@ -94,7 +99,7 @@ struct io_context {
        int nr_batch_requests;     /* Number of requests left in the batch */
 
        struct as_io_context *aic;
-       struct cfq_io_context *cic;
+       struct rb_root cic_root;
 };
 
 void put_io_context(struct io_context *ioc);
@@ -236,6 +241,7 @@ enum rq_flag_bits {
        __REQ_PM_RESUME,        /* resume request */
        __REQ_PM_SHUTDOWN,      /* shutdown request */
        __REQ_ORDERED_COLOR,    /* is before or after barrier */
+       __REQ_RW_SYNC,          /* request is sync (O_DIRECT) */
        __REQ_NR_BITS,          /* stops here */
 };
 
@@ -265,6 +271,7 @@ enum rq_flag_bits {
 #define REQ_PM_RESUME  (1 << __REQ_PM_RESUME)
 #define REQ_PM_SHUTDOWN        (1 << __REQ_PM_SHUTDOWN)
 #define REQ_ORDERED_COLOR      (1 << __REQ_ORDERED_COLOR)
+#define REQ_RW_SYNC    (1 << __REQ_RW_SYNC)
 
 /*
  * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
@@ -433,9 +440,6 @@ struct request_queue
 
 #define RQ_INACTIVE            (-1)
 #define RQ_ACTIVE              1
-#define RQ_SCSI_BUSY           0xffff
-#define RQ_SCSI_DONE           0xfffe
-#define RQ_SCSI_DISCONNECTING  0xffe0
 
 #define QUEUE_FLAG_CLUSTER     0       /* cluster several segments into 1 */
 #define QUEUE_FLAG_QUEUED      1       /* uses generic tag queueing */
@@ -607,6 +611,8 @@ extern void blk_plug_device(request_queue_t *);
 extern int blk_remove_plug(request_queue_t *);
 extern void blk_recount_segments(request_queue_t *, struct bio *);
 extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
+extern int sg_scsi_ioctl(struct file *, struct request_queue *,
+               struct gendisk *, struct scsi_ioctl_command __user *);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void blk_sync_queue(struct request_queue *q);