1. 28 1月, 2008 1 次提交
    • K
      blk_end_request: add new request completion interface (take 4) · 336cdb40
      Kiyoshi Ueda 提交于
      This patch adds 2 new interfaces for request completion:
        o blk_end_request()   : called without queue lock
        o __blk_end_request() : called with queue lock held
      
      blk_end_request takes 'error' as an argument instead of 'uptodate',
      which current end_that_request_* take.
      The meanings of values are below and the value is used when bio is
      completed.
          0 : success
        < 0 : error
      
      Some device drivers call some generic functions below between
      end_that_request_{first/chunk} and end_that_request_last().
        o add_disk_randomness()
        o blk_queue_end_tag()
        o blkdev_dequeue_request()
      These are called in the blk_end_request interfaces as a part of
      generic request completion.
      So all device drivers become to call above functions.
      To decide whether to call blkdev_dequeue_request(), blk_end_request
      uses list_empty(&rq->queuelist) (blk_queued_rq() macro is added for it).
      So drivers must re-initialize it using list_init() or so before calling
      blk_end_request if drivers use it for its specific purpose.
      (Currently, there is no driver which completes request without
       re-initializing the queuelist after used it.  So rq->queuelist
       can be used for the purpose above.)
      
      "Normal" drivers can be converted to use blk_end_request()
      in a standard way shown below.
      
       a) end_that_request_{chunk/first}
          spin_lock_irqsave()
          (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
          end_that_request_last()
          spin_unlock_irqrestore()
          => blk_end_request()
      
       b) spin_lock_irqsave()
          end_that_request_{chunk/first}
          (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
          end_that_request_last()
          spin_unlock_irqrestore()
          => spin_lock_irqsave()
             __blk_end_request()
             spin_unlock_irqsave()
      
       c) spin_lock_irqsave()
          (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
          end_that_request_last()
          spin_unlock_irqrestore()
          => blk_end_request()   or   spin_lock_irqsave()
                                      __blk_end_request()
                                      spin_unlock_irqrestore()
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      336cdb40
  2. 27 1月, 2008 1 次提交
  3. 26 1月, 2008 1 次提交
  4. 12 1月, 2008 1 次提交
  5. 09 11月, 2007 1 次提交
  6. 29 10月, 2007 1 次提交
    • J
      [BLOCK] Fix bad sharing of tag busy list on queues with shared tag maps · 6eca9004
      Jens Axboe 提交于
      For the locking to work, only the tag map and tag bit map may be shared
      (incidentally, I was just explaining this to Nick yesterday, but I
      apparently didn't review the code well enough myself). But we also share
      the busy list!  The busy_list must be queue private, or we need a
      block_queue_tag covering lock as well.
      
      So we have to move the busy_list to the queue. This'll work fine, and
      it'll actually also fix a problem with blk_queue_invalidate_tags() which
      will invalidate tags across all shared queues. This is a bit confusing,
      the low level driver should call it for each queue seperately since
      otherwise you cannot kill tags on just a single queue for eg a hard
      drive that stops responding. Since the function has no callers
      currently, it's not an issue.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6eca9004
  7. 16 10月, 2007 3 次提交
  8. 12 10月, 2007 1 次提交
  9. 10 10月, 2007 5 次提交
    • N
      Remove flush_dry_bio_endio · d24517d7
      NeilBrown 提交于
      The entire function of flush_dry_bio_endio is to undo the effects
      of bio_endio (when called on a barrier request).  So remove the
      function and the call to bio_endio.
      
      This allows us to remove "bi_size" from "struct request_queue".
      Signed-off-by: NNeil Brown <neilb@suse.de>
      
      ### Diffstat output
       ./block/ll_rw_blk.c      |   39 ++-------------------------------------
       ./include/linux/blkdev.h |    1 -
       2 files changed, 2 insertions(+), 38 deletions(-)
      
      diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      d24517d7
    • J
      Fix warnings with !CONFIG_BLOCK · f5ff8422
      Jens Axboe 提交于
      Hide everything in blkdev.h with CONFIG_BLOCK isn't set, and fixup
      the (few) files that fail to build because they were relying on blkdev.h
      pulling in extra includes for them.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f5ff8422
    • N
      Stop exporting blk_rq_bio_prep · 66846572
      NeilBrown 提交于
      blk_rq_bio_prep is exported for use in exactly
      one place.  That place can benefit from using
      the new blk_rq_append_bio instead.
      So
        - change dm-emc to call blk_rq_append_bio
        - stop exporting blk_rq_bio_prep, and
        - initialise rq_disk in blk_rq_bio_prep,
             as dm-emc needs it.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      
      diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      66846572
    • N
      New function blk_req_append_bio · 3001ca77
      NeilBrown 提交于
      ll_back_merge_fn is currently exported to SCSI where is it used,
      together with blk_rq_bio_prep, in exactly the same way these
      functions are used in __blk_rq_map_user.
      
      So move the common code into a new function (blk_rq_append_bio), and
      don't export ll_back_merge_fn any longer.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      
      diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      3001ca77
    • N
      Introduce rq_for_each_segment replacing rq_for_each_bio · 5705f702
      NeilBrown 提交于
      Every usage of rq_for_each_bio wraps a usage of
      bio_for_each_segment, so these can be combined into
      rq_for_each_segment.
      
      We define "struct req_iterator" to hold the 'bio' and 'index' that
      are needed for the double iteration.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      
      Various compile fixes by me...
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5705f702
  10. 27 7月, 2007 1 次提交
  11. 24 7月, 2007 2 次提交
  12. 22 7月, 2007 1 次提交
  13. 18 7月, 2007 1 次提交
  14. 16 7月, 2007 5 次提交
  15. 10 7月, 2007 1 次提交
  16. 10 5月, 2007 1 次提交
  17. 30 4月, 2007 1 次提交
  18. 12 2月, 2007 1 次提交
  19. 19 12月, 2006 2 次提交
  20. 12 12月, 2006 1 次提交
    • B
      [PATCH] remove blk_queue_activity_fn · 2b02a179
      Boaz Harrosh 提交于
      While working on bidi support at struct request level
      I have found that blk_queue_activity_fn is actually never used.
      The only user is in ide-probe.c with this code:
      
      	/* enable led activity for disk drives only */
      	if (drive->media == ide_disk && hwif->led_act)
      		blk_queue_activity_fn(q, hwif->led_act, drive);
      
      And led_act is never initialized anywhere.
      (Looking back at older kernels it was used in the PPC arch, but was removed around 2.6.18)
      Unless it is all for future use off course.
      (this patch is against linux-2.6-block.git as off 2006/12/4)
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      2b02a179
  21. 01 12月, 2006 1 次提交
  22. 21 10月, 2006 2 次提交
  23. 12 10月, 2006 1 次提交
  24. 05 10月, 2006 1 次提交
  25. 01 10月, 2006 3 次提交
    • A
      [PATCH] CONFIG_BLOCK: blk_congestion_wait() fix · bcfd8d36
      Andrew Morton 提交于
      Don't just do nothing: it'll cause busywaits all over writeback and page
      reclaim.
      
      For now, take a fixed-length nap.  Will improve when NFS starts waking up
      throttled processes.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bcfd8d36
    • D
      [PATCH] BLOCK: Make it possible to disable the block layer [try #6] · 9361401e
      David Howells 提交于
      Make it possible to disable the block layer.  Not all embedded devices require
      it, some can make do with just JFFS2, NFS, ramfs, etc - none of which require
      the block layer to be present.
      
      This patch does the following:
      
       (*) Introduces CONFIG_BLOCK to disable the block layer, buffering and blockdev
           support.
      
       (*) Adds dependencies on CONFIG_BLOCK to any configuration item that controls
           an item that uses the block layer.  This includes:
      
           (*) Block I/O tracing.
      
           (*) Disk partition code.
      
           (*) All filesystems that are block based, eg: Ext3, ReiserFS, ISOFS.
      
           (*) The SCSI layer.  As far as I can tell, even SCSI chardevs use the
           	 block layer to do scheduling.  Some drivers that use SCSI facilities -
           	 such as USB storage - end up disabled indirectly from this.
      
           (*) Various block-based device drivers, such as IDE and the old CDROM
           	 drivers.
      
           (*) MTD blockdev handling and FTL.
      
           (*) JFFS - which uses set_bdev_super(), something it could avoid doing by
           	 taking a leaf out of JFFS2's book.
      
       (*) Makes most of the contents of linux/blkdev.h, linux/buffer_head.h and
           linux/elevator.h contingent on CONFIG_BLOCK being set.  sector_div() is,
           however, still used in places, and so is still available.
      
       (*) Also made contingent are the contents of linux/mpage.h, linux/genhd.h and
           parts of linux/fs.h.
      
       (*) Makes a number of files in fs/ contingent on CONFIG_BLOCK.
      
       (*) Makes mm/bounce.c (bounce buffering) contingent on CONFIG_BLOCK.
      
       (*) set_page_dirty() doesn't call __set_page_dirty_buffers() if CONFIG_BLOCK
           is not enabled.
      
       (*) fs/no-block.c is created to hold out-of-line stubs and things that are
           required when CONFIG_BLOCK is not set:
      
           (*) Default blockdev file operations (to give error ENODEV on opening).
      
       (*) Makes some /proc changes:
      
           (*) /proc/devices does not list any blockdevs.
      
           (*) /proc/diskstats and /proc/partitions are contingent on CONFIG_BLOCK.
      
       (*) Makes some compat ioctl handling contingent on CONFIG_BLOCK.
      
       (*) If CONFIG_BLOCK is not defined, makes sys_quotactl() return -ENODEV if
           given command other than Q_SYNC or if a special device is specified.
      
       (*) In init/do_mounts.c, no reference is made to the blockdev routines if
           CONFIG_BLOCK is not defined.  This does not prohibit NFS roots or JFFS2.
      
       (*) The bdflush, ioprio_set and ioprio_get syscalls can now be absent (return
           error ENOSYS by way of cond_syscall if so).
      
       (*) The seclvl_bd_claim() and seclvl_bd_release() security calls do nothing if
           CONFIG_BLOCK is not set, since they can't then happen.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9361401e
    • J
      [PATCH] Allow file systems to differentiate between data and meta reads · 5404bc7a
      Jens Axboe 提交于
      We can use this information for making more intelligent priority
      decisions, and it will also be useful for blktrace.
      Signed-off-by: NJens Axboe <axboe@suse.de>
      5404bc7a