1. 28 Jan, 2008 6 commits
    • Kiyoshi Ueda's avatar
      blk_end_request: changing DAC960 (take 4) · 0156c254
      Kiyoshi Ueda authored
      This patch converts DAC960 to use blk_end_request interfaces.
      Related 'UpToDate' arguments are converted to 'Error'.
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      0156c254
    • Kiyoshi Ueda's avatar
      blk_end_request: changing um (take 4) · 4898b53a
      Kiyoshi Ueda authored
      This patch converts um to use blk_end_request interfaces.
      Related 'uptodate' arguments are converted to 'error'.
      
      As a result, the interface of internal function, ubd_end_request(),
      is changed.
      
      Cc: Jeff Dike <jdike@karaya.com>
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      4898b53a
    • Kiyoshi Ueda's avatar
      blk_end_request: changing arm (take 4) · 650e9cfd
      Kiyoshi Ueda authored
      This patch converts arm's OMAP mailbox driver to use
      blk_end_request interfaces.
      
      If the original code was converted literally, blk_end_request would
      be called with '-EIO' because end_that_request_last() were called
      with '0' (i.e. failure).
      But I think these '0's are bugs in the original code because it's
      unlikely that all requests are treated as failure.
      (The bugs should have no effect unless these requests have an end_io
       callback.)
      
      So I changed them to pass '0' (i.e. success) to blk_end_request.
      
      Cc: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
      Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      650e9cfd
    • Kiyoshi Ueda's avatar
      blk_end_request: changing block layer core (take 4) · 9e6e39f2
      Kiyoshi Ueda authored
      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: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      9e6e39f2
    • Kiyoshi Ueda's avatar
      blk_end_request: add/export functions to get request size (take 4) · 3b11313a
      Kiyoshi Ueda authored
      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: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      3b11313a
    • Kiyoshi Ueda's avatar
      blk_end_request: add new request completion interface (take 4) · 336cdb40
      Kiyoshi Ueda authored
      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: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      336cdb40
  2. 27 Jan, 2008 34 commits