1. 11 6月, 2009 5 次提交
    • K
      block: add request clone interface (v2) · b0fd271d
      Kiyoshi Ueda 提交于
      This patch adds the following 2 interfaces for request-stacking drivers:
      
        - blk_rq_prep_clone(struct request *clone, struct request *orig,
      		      struct bio_set *bs, gfp_t gfp_mask,
      		      int (*bio_ctr)(struct bio *, struct bio*, void *),
      		      void *data)
            * Clones bios in the original request to the clone request
              (bio_ctr is called for each cloned bios.)
            * Copies attributes of the original request to the clone request.
              The actual data parts (e.g. ->cmd, ->buffer, ->sense) are not
              copied.
      
        - blk_rq_unprep_clone(struct request *clone)
            * Frees cloned bios from the clone request.
      
      Request stacking drivers (e.g. request-based dm) need to make a clone
      request for a submitted request and dispatch it to other devices.
      
      To allocate request for the clone, request stacking drivers may not
      be able to use blk_get_request() because the allocation may be done
      in an irq-disabled context.
      So blk_rq_prep_clone() takes a request allocated by the caller
      as an argument.
      
      For each clone bio in the clone request, request stacking drivers
      should be able to set up their own completion handler.
      So blk_rq_prep_clone() takes a callback function which is called
      for each clone bio, and a pointer for private data which is passed
      to the callback.
      
      NOTE:
      blk_rq_prep_clone() doesn't copy any actual data of the original
      request.  Pages are shared between original bios and cloned bios.
      So caller must not complete the original request before the clone
      request.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      b0fd271d
    • O
      floppy: fix hibernation · 5e50b9ef
      Ondrej Zary 提交于
      Based on Ingo Molnar's patch from 2006, this makes the floppy work after
      resume from hibernation, at least on my machine.
      
      This fix resets the floppy controller on resume.  It was experimentally
      determined to bring the controller back to life - we don't really know why
      it works.
      
      floppy_init() does the same thing at boot/modprobe time.
      Signed-off-by: NOndrej Zary <linux@rainbow-software.org>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Ingo Molnar <mingo@elte.hu>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5e50b9ef
    • R
      ramdisk: remove long-deprecated "ramdisk=" boot-time parameter · 1adbee50
      Robert P. J. Day 提交于
      The "ramdisk" parameter was removed from the defunct rd.c file quite some
      time ago, in favour of the more specific "ramdisk_size" parameter so, for
      consistency, the same should be done here.
      Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Acked-by: NNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      1adbee50
    • M
      fs/bio.c: add missing __user annotation · 0e0c6212
      Michal Simek 提交于
      As reported by sparse:
      
      fs/bio.c:720:13: warning: incorrect type in assignment (different address spaces)
      fs/bio.c:720:13:    expected char *iov_addr
      fs/bio.c:720:13:    got void [noderef] <asn:1>*
      fs/bio.c:724:36: warning: incorrect type in argument 2 (different address spaces)
      fs/bio.c:724:36:    expected void const [noderef] <asn:1>*from
      fs/bio.c:724:36:    got char *iov_addr
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0e0c6212
    • N
      block: prevent possible io_context->refcount overflow · d9c7d394
      Nikanth Karthikesan 提交于
      Currently io_context has an atomic_t(32-bit) as refcount.  In the case of
      cfq, for each device against whcih a task does I/O, a reference to the
      io_context would be taken.  And when there are multiple process sharing
      io_contexts(CLONE_IO) would also have a reference to the same io_context.
      
      Theoretically the possible maximum number of processes sharing the same
      io_context + the number of disks/cfq_data referring to the same io_context
      can overflow the 32-bit counter on a very high-end machine.
      
      Even though it is an improbable case, let us make it atomic_long_t.
      Signed-off-by: NNikanth Karthikesan <knikanth@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      d9c7d394
  2. 09 6月, 2009 12 次提交
  3. 05 6月, 2009 1 次提交
  4. 03 6月, 2009 1 次提交
  5. 02 6月, 2009 6 次提交
  6. 30 5月, 2009 1 次提交
  7. 28 5月, 2009 1 次提交
  8. 27 5月, 2009 2 次提交
    • K
      block: fix no diskstat problem · 3c4198e8
      Kiyoshi Ueda 提交于
      The commit below in 2.6-block/for-2.6.31 causes no diskstat problem
      because the blk_discard_rq() check was added with '&&'.
      It should be 'blk_fs_request() || blk_discard_rq()'.
      This patch does it and fixes the no diskstat problem.
      Please review and apply.
      
      ------ /proc/diskstat without this patch -------------------------------------
         8       0 sda 0 0 0 0 0 0 0 0 0 0 0
      ------------------------------------------------------------------------------
      
      ----- /proc/diskstat with this patch applied ---------------------------------
         8       0 sda 4186 303 373621 61600 9578 3859 107468 169479 2 89755 231059
      ------------------------------------------------------------------------------
      
      --------------------------------------------------------------------------
      commit c69d4854
      Author: Jens Axboe <jens.axboe@oracle.com>
      Date:   Fri Apr 24 08:12:19 2009 +0200
      
          block: include discard requests in IO accounting
      
          We currently don't do merging on discard requests, but we potentially
          could. If we do, then we need to include discard requests in the IO
          accounting, or merging would end up decrementing in_flight IO counters
          for an IO which never incremented them.
      
          So enable accounting for discard requests.
      
      <snip>
      
       static inline int blk_do_io_stat(struct request *rq)
       {
      -       return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq);
      +       return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq) &&
      +               blk_discard_rq(rq);
       }
      --------------------------------------------------------------------------
      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>
      3c4198e8
    • J
      block: fix oops with block tag queueing · ba396a6c
      James Bottomley 提交于
      commit e8939a50466fd963eb1ba9118c34b9ffb7ff6aa6
      Author: Tejun Heo <tj@kernel.org>
      Date:   Fri May 8 11:54:16 2009 +0900
      
          block: implement and enforce request peek/start/fetch
      
      Added a BUG_ON(blk_queued_rq(req)) to the top of blk_finish_req().
      Unfortunately, this checks whether req->queuelist is empty.  This list
      is doing double duty both as the queue list and the tag list, so tagged
      requests come in here with this not empty and boom (the tag list is
      emptied by blk_queue_end_tag() lower down).
      
      Fix this by moving the BUG_ON to below the end tag we also seem
      vulnerable to this in blk_requeue_request() as well.  I think all uses
      of blk_queued_rq() need auditing because the check is clearly wrong in
      the tagged case.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ba396a6c
  9. 23 5月, 2009 8 次提交
  10. 22 5月, 2009 3 次提交