]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Oct 2008 16:29:55 +0000 (09:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Oct 2008 16:29:55 +0000 (09:29 -0700)
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: remove __generic_unplug_device() from exports
  block: move q->unplug_work initialization
  blktrace: pass zfcp driver data
  blktrace: add support for driver data
  block: fix current kernel-doc warnings
  block: only call ->request_fn when the queue is not stopped
  block: simplify string handling in elv_iosched_store()
  block: fix kernel-doc for blk_alloc_devt()
  block: fix nr_phys_segments miscalculation bug
  block: add partition attribute for partition number
  block: add BIG FAT WARNING to CONFIG_DEBUG_BLOCK_EXT_DEVT
  softirq: Add support for triggering softirq work on softirqs.

1  2 
block/blk-core.c
include/linux/bio.h
include/linux/blkdev.h

diff --combined block/blk-core.c
index 9e79a485e4f376db04180523e31b5e51b8c24a13,81a496004976e9f406e5b44ca5fc72643fb87c25..c3df30cfb3fc332d5a503677b5b383dcf2660ec2
@@@ -257,7 -257,6 +257,6 @@@ void __generic_unplug_device(struct req
  
        q->request_fn(q);
  }
- EXPORT_SYMBOL(__generic_unplug_device);
  
  /**
   * generic_unplug_device - fire a request queue
@@@ -325,6 -324,9 +324,9 @@@ EXPORT_SYMBOL(blk_unplug)
  
  static void blk_invoke_request_fn(struct request_queue *q)
  {
+       if (unlikely(blk_queue_stopped(q)))
+               return;
        /*
         * one level of recursion is ok and is much faster than kicking
         * the unplug handling
@@@ -399,8 -401,13 +401,13 @@@ void blk_sync_queue(struct request_queu
  EXPORT_SYMBOL(blk_sync_queue);
  
  /**
-  * blk_run_queue - run a single device queue
+  * __blk_run_queue - run a single device queue
   * @q:        The queue to run
+  *
+  * Description:
+  *    See @blk_run_queue. This variant must be called with the queue lock
+  *    held and interrupts disabled.
+  *
   */
  void __blk_run_queue(struct request_queue *q)
  {
@@@ -418,6 -425,12 +425,12 @@@ EXPORT_SYMBOL(__blk_run_queue)
  /**
   * blk_run_queue - run a single device queue
   * @q: The queue to run
+  *
+  * Description:
+  *    Invoke request handling on this queue, if it has pending work to do.
+  *    May be used to restart queueing when a request has completed. Also
+  *    See @blk_start_queueing.
+  *
   */
  void blk_run_queue(struct request_queue *q)
  {
@@@ -501,6 -514,7 +514,7 @@@ struct request_queue *blk_alloc_queue_n
        init_timer(&q->unplug_timer);
        setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
        INIT_LIST_HEAD(&q->timeout_list);
+       INIT_WORK(&q->unplug_work, blk_unplug_work);
  
        kobject_init(&q->kobj, &blk_queue_ktype);
  
@@@ -884,7 -898,8 +898,8 @@@ EXPORT_SYMBOL(blk_get_request)
   *
   * This is basically a helper to remove the need to know whether a queue
   * is plugged or not if someone just wants to initiate dispatch of requests
-  * for this queue.
+  * for this queue. Should be used to start queueing on a device outside
+  * of ->request_fn() context. Also see @blk_run_queue.
   *
   * The queue lock must be held with interrupts disabled.
   */
@@@ -1003,8 -1018,9 +1018,9 @@@ static void part_round_stats_single(in
  }
  
  /**
-  * part_round_stats() - Round off the performance stats on a struct
-  * disk_stats.
+  * part_round_stats() - Round off the performance stats on a struct disk_stats.
+  * @cpu: cpu number for stats access
+  * @part: target partition
   *
   * The average IO queue length and utilisation statistics are maintained
   * by observing the current state of the queue length and the amount of
@@@ -1075,15 -1091,8 +1091,15 @@@ void init_request_from_bio(struct reque
        /*
         * inherit FAILFAST from bio (for read-ahead, and explicit FAILFAST)
         */
 -      if (bio_rw_ahead(bio) || bio_failfast(bio))
 -              req->cmd_flags |= REQ_FAILFAST;
 +      if (bio_rw_ahead(bio))
 +              req->cmd_flags |= (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
 +                                 REQ_FAILFAST_DRIVER);
 +      if (bio_failfast_dev(bio))
 +              req->cmd_flags |= REQ_FAILFAST_DEV;
 +      if (bio_failfast_transport(bio))
 +              req->cmd_flags |= REQ_FAILFAST_TRANSPORT;
 +      if (bio_failfast_driver(bio))
 +              req->cmd_flags |= REQ_FAILFAST_DRIVER;
  
        /*
         * REQ_BARRIER implies no merging, but lets make it explicit
diff --combined include/linux/bio.h
index 1beda208cbfbf17d1980dee03c49cd7d43678b7e,dc3cec386a998c4f04dc060df8db151c75d54609..1c91a176b9ae8206f872a55a1318fb74048dbdec
@@@ -79,6 -79,13 +79,13 @@@ struct bio 
  
        unsigned int            bi_size;        /* residual I/O count */
  
+       /*
+        * To keep track of the max segment size, we account for the
+        * sizes of the first and last mergeable segments in this bio.
+        */
+       unsigned int            bi_seg_front_size;
+       unsigned int            bi_seg_back_size;
        unsigned int            bi_max_vecs;    /* max bvl_vecs we can hold */
  
        unsigned int            bi_comp_cpu;    /* completion CPU */
   * bit 2 -- barrier
   *    Insert a serialization point in the IO queue, forcing previously
   *    submitted IO to be completed before this oen is issued.
 - * bit 3 -- fail fast, don't want low level driver retries
 - * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
 + * bit 3 -- synchronous I/O hint: the block layer will unplug immediately
   *    Note that this does NOT indicate that the IO itself is sync, just
   *    that the block layer will not postpone issue of this IO by plugging.
 - * bit 5 -- metadata request
 + * bit 4 -- metadata request
   *    Used for tracing to differentiate metadata and data IO. May also
   *    get some preferential treatment in the IO scheduler
 - * bit 6 -- discard sectors
 + * bit 5 -- discard sectors
   *    Informs the lower level device that this range of sectors is no longer
   *    used by the file system and may thus be freed by the device. Used
   *    for flash based storage.
 + * bit 6 -- fail fast device errors
 + * bit 7 -- fail fast transport errors
 + * bit 8 -- fail fast driver errors
 + *    Don't want driver retries for any fast fail whatever the reason.
   */
  #define BIO_RW                0       /* Must match RW in req flags (blkdev.h) */
  #define BIO_RW_AHEAD  1       /* Must match FAILFAST in req flags */
  #define BIO_RW_BARRIER        2
 -#define BIO_RW_FAILFAST       3
 -#define BIO_RW_SYNC   4
 -#define BIO_RW_META   5
 -#define BIO_RW_DISCARD        6
 +#define BIO_RW_SYNC   3
 +#define BIO_RW_META   4
 +#define BIO_RW_DISCARD        5
 +#define BIO_RW_FAILFAST_DEV           6
 +#define BIO_RW_FAILFAST_TRANSPORT     7
 +#define BIO_RW_FAILFAST_DRIVER                8
  
  /*
   * upper 16 bits of bi_rw define the io priority of this bio
  #define bio_sectors(bio)      ((bio)->bi_size >> 9)
  #define bio_barrier(bio)      ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
  #define bio_sync(bio)         ((bio)->bi_rw & (1 << BIO_RW_SYNC))
 -#define bio_failfast(bio)     ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
 +#define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
 +#define bio_failfast_transport(bio)   \
 +      ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
 +#define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER))
  #define bio_rw_ahead(bio)     ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
  #define bio_rw_meta(bio)      ((bio)->bi_rw & (1 << BIO_RW_META))
  #define bio_discard(bio)      ((bio)->bi_rw & (1 << BIO_RW_DISCARD))
diff --combined include/linux/blkdev.h
index f3491d2252686074ad939d511b8b762290deca99,8eed8b15f992b29128a13ff48b69f938eb7e89a3..b4fe68fe3a573b8b0e94a4c17153c76880a06f01
@@@ -87,9 -87,7 +87,9 @@@ enum 
   */
  enum rq_flag_bits {
        __REQ_RW,               /* not set, read. set, write */
 -      __REQ_FAILFAST,         /* no low level driver retries */
 +      __REQ_FAILFAST_DEV,     /* no driver retries of device errors */
 +      __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
 +      __REQ_FAILFAST_DRIVER,  /* no driver retries of driver errors */
        __REQ_DISCARD,          /* request to discard sectors */
        __REQ_SORTED,           /* elevator knows about this request */
        __REQ_SOFTBARRIER,      /* may not be passed by ioscheduler */
  };
  
  #define REQ_RW                (1 << __REQ_RW)
 +#define REQ_FAILFAST_DEV      (1 << __REQ_FAILFAST_DEV)
 +#define REQ_FAILFAST_TRANSPORT        (1 << __REQ_FAILFAST_TRANSPORT)
 +#define REQ_FAILFAST_DRIVER   (1 << __REQ_FAILFAST_DRIVER)
  #define REQ_DISCARD   (1 << __REQ_DISCARD)
 -#define REQ_FAILFAST  (1 << __REQ_FAILFAST)
  #define REQ_SORTED    (1 << __REQ_SORTED)
  #define REQ_SOFTBARRIER       (1 << __REQ_SOFTBARRIER)
  #define REQ_HARDBARRIER       (1 << __REQ_HARDBARRIER)
@@@ -564,12 -560,7 +564,12 @@@ enum 
  #define blk_special_request(rq)       ((rq)->cmd_type == REQ_TYPE_SPECIAL)
  #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE)
  
 -#define blk_noretry_request(rq)       ((rq)->cmd_flags & REQ_FAILFAST)
 +#define blk_failfast_dev(rq)  ((rq)->cmd_flags & REQ_FAILFAST_DEV)
 +#define blk_failfast_transport(rq) ((rq)->cmd_flags & REQ_FAILFAST_TRANSPORT)
 +#define blk_failfast_driver(rq)       ((rq)->cmd_flags & REQ_FAILFAST_DRIVER)
 +#define blk_noretry_request(rq)       (blk_failfast_dev(rq) ||        \
 +                               blk_failfast_transport(rq) ||  \
 +                               blk_failfast_driver(rq))
  #define blk_rq_started(rq)    ((rq)->cmd_flags & REQ_STARTED)
  
  #define blk_account_rq(rq)    (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) 
@@@ -865,7 -856,6 +865,6 @@@ extern void blk_ordered_complete_seq(st
  extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
  extern void blk_dump_rq_flags(struct request *, char *);
  extern void generic_unplug_device(struct request_queue *);
- extern void __generic_unplug_device(struct request_queue *);
  extern long nr_blockdev_pages(void);
  
  int blk_get_queue(struct request_queue *);