1. 28 1月, 2008 6 次提交
    • K
      blk_end_request: remove/unexport end_that_request_* (take 4) · 3bcddeac
      Kiyoshi Ueda 提交于
      This patch removes the following functions:
        o end_that_request_first()
        o end_that_request_chunk()
      and stops exporting the functions below:
        o end_that_request_last()
      
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      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>
      3bcddeac
    • K
      blk_end_request: add bidi completion interface (take 4) · e3a04fe3
      Kiyoshi Ueda 提交于
      This patch adds a variant of the interface, blk_end_bidi_request(),
      which completes a bidi request.
      
      Bidi request must be completed as a whole, both rq and rq->next_rq
      at once.  So the interface has 2 arguments for completion size.
      
      As for ->end_io, only rq->end_io is called (rq->next_rq->end_io is not
      called).  So if special completion handling is needed, the handler
      must be set to rq->end_io.
      And the handler must take care of freeing next_rq too, since
      the interface doesn't care of it if rq->end_io is not NULL.
      
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      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>
      e3a04fe3
    • K
      blk_end_request: add callback feature (take 4) · e19a3ab0
      Kiyoshi Ueda 提交于
      This patch adds a variant of the interface, blk_end_request_callback(),
      which has driver callback feature.
      
      Drivers may need to do special works between end_that_request_first()
      and end_that_request_last().
      For such drivers, blk_end_request_callback() allows it to pass
      a callback function which is called between end_that_request_first()
      and end_that_request_last().
      
      This interface is only for fallback of other blk_end_request interfaces.
      Drivers should avoid their tricky behaviors and use other interfaces
      as much as possible.
      
      Currently, only one driver, ide-cd, needs this interface.
      So this interface should/will be removed, after the driver removes
      such tricky behaviors.
      
      o ide-cd (cdrom_newpc_intr())
        In PIO mode, cdrom_newpc_intr() needs to defer end_that_request_last()
        until the device clears DRQ_STAT and raises an interrupt after
        end_that_request_first().
        So end_that_request_first() and end_that_request_last() are called
        separately in cdrom_newpc_intr().
      
        This means blk_end_request_callback() has to return without
        completing request even if no leftover in the request.
        To satisfy the requirement, callback function has return value
        so that drivers can tell blk_end_request_callback() to return
        without completing request.
      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>
      e19a3ab0
    • K
      blk_end_request: changing block layer core (take 4) · 9e6e39f2
      Kiyoshi Ueda 提交于
      This patch converts core parts of block layer to use blk_end_request
      interfaces.  Related 'uptodate' arguments are converted to 'error'.
      
      'dequeue' argument was originally introduced for end_dequeued_request(),
      where no attempt should be made to dequeue the request as it's already
      dequeued.
      However, it's not necessary as it can be checked with
      list_empty(&rq->queuelist).
      (Dequeued request has empty list and queued request doesn't.)
      And it has been done in blk_end_request interfaces.
      
      As a result of this patch, end_queued_request() and
      end_dequeued_request() become identical.  A future patch will merge
      and rename them and change users of those functions.
      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>
      9e6e39f2
    • K
      blk_end_request: add/export functions to get request size (take 4) · 3b11313a
      Kiyoshi Ueda 提交于
      This patch adds/exports functions to get the size of request in bytes.
      They are useful because blk_end_request interfaces take bytes
      as a completed I/O size instead of sectors.
      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>
      3b11313a
    • 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. 25 1月, 2008 4 次提交
    • G
      Kobject: rename kobject_init_ng() to kobject_init() · f9cb074b
      Greg Kroah-Hartman 提交于
      Now that the old kobject_init() function is gone, rename
      kobject_init_ng() to kobject_init() to clean up the namespace.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f9cb074b
    • G
      Kobject: rename kobject_add_ng() to kobject_add() · b2d6db58
      Greg Kroah-Hartman 提交于
      Now that the old kobject_add() function is gone, rename kobject_add_ng()
      to kobject_add() to clean up the namespace.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b2d6db58
    • G
      Kobject: convert block/ll_rw_blk.c to use kobject_init/add_ng() · d5a379f7
      Greg Kroah-Hartman 提交于
      This converts the code to use the new kobject functions, cleaning up the
      logic in doing so.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d5a379f7
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3
  3. 12 1月, 2008 1 次提交
  4. 27 11月, 2007 1 次提交
  5. 09 11月, 2007 2 次提交
  6. 02 11月, 2007 2 次提交
  7. 29 10月, 2007 4 次提交
  8. 24 10月, 2007 1 次提交
  9. 23 10月, 2007 3 次提交
  10. 20 10月, 2007 2 次提交
  11. 18 10月, 2007 1 次提交
  12. 17 10月, 2007 3 次提交
  13. 16 10月, 2007 7 次提交
  14. 13 10月, 2007 1 次提交
  15. 10 10月, 2007 2 次提交
    • N
      Drop 'size' argument from bio_endio and bi_end_io · 6712ecf8
      NeilBrown 提交于
      As bi_end_io is only called once when the reqeust is complete,
      the 'size' argument is now redundant.  Remove it.
      
      Now there is no need for bio_endio to subtract the size completed
      from bi_size.  So don't do that either.
      
      While we are at it, change bi_end_io to return void.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6712ecf8
    • N
      Don't decrement bi_size in bio_endio · 5bb23a68
      NeilBrown 提交于
      The only caller of bio_endio that does not pass the full bi_size
      is end_that_request_first.  Also, no ->bi_end_io method is really
      interested in bi_size being decremented.
      
      So move the decrement and related code into ll_rw_blk and merge it
      with order_bio_endio to form req_bio_endio which does endio functionality
      specific to request completion.
      
      As some ->bi_end_io methods do check bi_size of 0, we set it thus for
      now, but that will go in the next patch.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      
      ### Diffstat output
       ./block/ll_rw_blk.c |   42 +++++++++++++++++++++++++++---------------
       ./fs/bio.c          |   23 +++++++++++------------
       2 files changed, 38 insertions(+), 27 deletions(-)
      
      diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5bb23a68