1. 09 11月, 2017 1 次提交
  2. 07 9月, 2017 1 次提交
  3. 19 6月, 2017 1 次提交
    • N
      rbd: use bio_clone_fast() instead of bio_clone() · f856dc36
      NeilBrown 提交于
      bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
      so there is no need for a copy.
      bio_clone_fast() can be used instead, which avoids making the copy.
      
      This requires that we provide a bio_set.  bio_clone() uses fs_bio_set,
      but it isn't, in general, safe to use the same bio_set at different
      levels of the stack, as that can lead to deadlocks.  As filesystems
      use fs_bio_set, block devices shouldn't.
      
      As rbd never stacks, it is safe to have a single global bio_set for
      all rbd devices to use.  So allocate that when the module is
      initialised, and use it with bio_clone_fast().
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f856dc36
  4. 09 6月, 2017 2 次提交
    • C
      blk-mq: switch ->queue_rq return value to blk_status_t · fc17b653
      Christoph Hellwig 提交于
      Use the same values for use for request completion errors as the return
      value from ->queue_rq.  BLK_STS_RESOURCE is special cased to cause
      a requeue, and all the others are completed as-is.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      fc17b653
    • C
      block: introduce new block status code type · 2a842aca
      Christoph Hellwig 提交于
      Currently we use nornal Linux errno values in the block layer, and while
      we accept any error a few have overloaded magic meanings.  This patch
      instead introduces a new  blk_status_t value that holds block layer specific
      status codes and explicitly explains their meaning.  Helpers to convert from
      and to the previous special meanings are provided for now, but I suspect
      we want to get rid of them in the long run - those drivers that have a
      errno input (e.g. networking) usually get errnos that don't know about
      the special block layer overloads, and similarly returning them to userspace
      will usually return somethings that strictly speaking isn't correct
      for file system operations, but that's left as an exercise for later.
      
      For now the set of errors is a very limited set that closely corresponds
      to the previous overloaded errno values, but there is some low hanging
      fruite to improve it.
      
      blk_status_t (ab)uses the sparse __bitwise annotations to allow for sparse
      typechecking, so that we can easily catch places passing the wrong values.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      2a842aca
  5. 29 5月, 2017 1 次提交
    • I
      rbd: implement REQ_OP_WRITE_ZEROES · 6ac56951
      Ilya Dryomov 提交于
      Commit 93c1defe ("rbd: remove the discard_zeroes_data flag")
      explicitly didn't implement REQ_OP_WRITE_ZEROES for rbd, while the
      following commit 48920ff2 ("block: remove the discard_zeroes_data
      flag") dropped ->discard_zeroes_data in favor of REQ_OP_WRITE_ZEROES.
      
      rbd does support efficient zeroing via CEPH_OSD_OP_ZERO opcode and will
      release either some or all blocks depending on whether the zeroing
      request is rbd_obj_bytes() aligned.  This is how we currently implement
      discards, so REQ_OP_WRITE_ZEROES can be identical to REQ_OP_DISCARD for
      now.  Caveats:
      
      - REQ_NOUNMAP is ignored, but AFAICT that's true of at least two other
        current implementations - nvme and loop
      
      - there is no ->write_zeroes_alignment and blk_bio_write_zeroes_split()
        is hence less helpful than blk_bio_discard_split(), but this can (and
        should) be fixed on the rbd side
      
      In the future we will split these into two code paths to respect
      REQ_NOUNMAP on zeroout and save on zeroing blocks that couldn't be
      released on discard.
      
      Fixes: 93c1defe ("rbd: remove the discard_zeroes_data flag")
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NJason Dillaman <dillaman@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      6ac56951
  6. 09 5月, 2017 1 次提交
  7. 04 5月, 2017 10 次提交
  8. 02 5月, 2017 1 次提交
  9. 09 4月, 2017 1 次提交
  10. 31 3月, 2017 1 次提交
  11. 07 3月, 2017 1 次提交
  12. 25 2月, 2017 1 次提交
  13. 20 2月, 2017 15 次提交
  14. 02 2月, 2017 1 次提交
  15. 01 2月, 2017 1 次提交
    • C
      block: fold cmd_type into the REQ_OP_ space · aebf526b
      Christoph Hellwig 提交于
      Instead of keeping two levels of indirection for requests types, fold it
      all into the operations.  The little caveat here is that previously
      cmd_type only applied to struct request, while the request and bio op
      fields were set to plain REQ_OP_READ/WRITE even for passthrough
      operations.
      
      Instead this patch adds new REQ_OP_* for SCSI passthrough and driver
      private requests, althought it has to add two for each so that we
      can communicate the data in/out nature of the request.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      aebf526b
  16. 14 1月, 2017 1 次提交
    • P
      locking/atomic, kref: Add kref_read() · 2c935bc5
      Peter Zijlstra 提交于
      Since we need to change the implementation, stop exposing internals.
      
      Provide kref_read() to read the current reference count; typically
      used for debug messages.
      
      Kills two anti-patterns:
      
      	atomic_read(&kref->refcount)
      	kref->refcount.counter
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      2c935bc5