1. 02 10月, 2009 6 次提交
    • J
      Add a tracepoint for block request remapping · b0da3f0d
      Jun'ichi Nomura 提交于
      Since 2.6.31 now has request-based device-mapper, it's useful to have
      a tracepoint for request-remapping as well as bio-remapping.
      This patch adds a tracepoint for request-remapping, trace_block_rq_remap().
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      b0da3f0d
    • C
      block: allow large discard requests · 67efc925
      Christoph Hellwig 提交于
      Currently we set the bio size to the byte equivalent of the blocks to
      be trimmed when submitting the initial DISCARD ioctl.  That means it
      is subject to the max_hw_sectors limitation of the HBA which is
      much lower than the size of a DISCARD request we can support.
      Add a separate max_discard_sectors tunable to limit the size for discard
      requests.
      
      We limit the max discard request size in bytes to 32bit as that is the
      limit for bio->bi_size.  This could be much larger if we had a way to pass
      that information through the block layer.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      67efc925
    • C
      block: use normal I/O path for discard requests · c15227de
      Christoph Hellwig 提交于
      prepare_discard_fn() was being called in a place where memory allocation
      was effectively impossible.  This makes it inappropriate for all but
      the most trivial translations of Linux's DISCARD operation to the block
      command set.  Additionally adding a payload there makes the ownership
      of the bio backing unclear as it's now allocated by the device driver
      and not the submitter as usual.
      
      It is replaced with QUEUE_FLAG_DISCARD which is used to indicate whether
      the queue supports discard operations or not.  blkdev_issue_discard now
      allocates a one-page, sector-length payload which is the right thing
      for the common ATA and SCSI implementations.
      
      The mtd implementation of prepare_discard_fn() is replaced with simply
      checking for the request being a discard.
      
      Largely based on a previous patch from Matthew Wilcox <matthew@wil.cx>
      which did the prepare_discard_fn but not the different payload allocation
      yet.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c15227de
    • Z
      Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs · 48c0d4d4
      Zdenek Kabelac 提交于
      Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
      introduced in commit 1d54ad6d.
      Release kobject also in case the request_fn is NULL.
      
      Problem was noticed via kmemleak backtrace when some sysfs entries were
      note properly destroyed during  device removal:
      
      unreferenced object 0xffff88001aa76640 (size 80):
        comm "lvcreate", pid 2120, jiffies 4294885144
        hex dump (first 32 bytes):
          01 00 00 00 00 00 00 00 f0 65 a7 1a 00 88 ff ff  .........e......
          90 66 a7 1a 00 88 ff ff 86 1d 53 81 ff ff ff ff  .f........S.....
        backtrace:
          [<ffffffff813f9cc6>] kmemleak_alloc+0x26/0x60
          [<ffffffff8111d693>] kmem_cache_alloc+0x133/0x1c0
          [<ffffffff81195891>] sysfs_new_dirent+0x41/0x120
          [<ffffffff81194b0c>] sysfs_add_file_mode+0x3c/0xb0
          [<ffffffff81197c81>] internal_create_group+0xc1/0x1a0
          [<ffffffff81197d93>] sysfs_create_group+0x13/0x20
          [<ffffffff810d8004>] blk_trace_init_sysfs+0x14/0x20
          [<ffffffff8123f45c>] blk_register_queue+0x3c/0xf0
          [<ffffffff812447e4>] add_disk+0x94/0x160
          [<ffffffffa00d8b08>] dm_create+0x598/0x6e0 [dm_mod]
          [<ffffffffa00de951>] dev_create+0x51/0x350 [dm_mod]
          [<ffffffffa00de823>] ctl_ioctl+0x1a3/0x240 [dm_mod]
          [<ffffffffa00de8f2>] dm_compat_ctl_ioctl+0x12/0x20 [dm_mod]
          [<ffffffff81177bfd>] compat_sys_ioctl+0xcd/0x4f0
          [<ffffffff81036ed8>] sysenter_dispatch+0x7/0x2c
          [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NZdenek Kabelac <zkabelac@redhat.com>
      Reviewed-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      48c0d4d4
    • M
      block: Do not clamp max_hw_sectors for stacking devices · 5dee2477
      Martin K. Petersen 提交于
      Stacking devices do not have an inherent max_hw_sector limit.  Set the
      default to INT_MAX so we are bounded only by capabilities of the
      underlying storage.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5dee2477
    • M
      block: Set max_sectors correctly for stacking devices · 80ddf247
      Martin K. Petersen 提交于
      The topology changes unintentionally caused SAFE_MAX_SECTORS to be set
      for stacking devices.  Set the default limit to BLK_DEF_MAX_SECTORS and
      provide SAFE_MAX_SECTORS in blk_queue_make_request() for legacy hw
      drivers that depend on the old behavior.
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      80ddf247
  2. 20 9月, 2009 1 次提交
  3. 16 9月, 2009 1 次提交
  4. 14 9月, 2009 5 次提交
  5. 11 9月, 2009 17 次提交
  6. 02 9月, 2009 1 次提交
    • N
      block: Allow changing max_sectors_kb above the default 512 · c295fc05
      Nikanth Karthikesan 提交于
      The patch "block: Use accessor functions for queue limits"
      (ae03bf63) changed queue_max_sectors_store()
      to use blk_queue_max_sectors() instead of directly assigning the value.
      
      But blk_queue_max_sectors() differs a bit
      1. It sets both max_sectors_kb, and max_hw_sectors_kb
      2. Never allows one to change max_sectors_kb above BLK_DEF_MAX_SECTORS. If one
      specifies a value greater then max_hw_sectors is set to that value but
      max_sectors is set to BLK_DEF_MAX_SECTORS
      
      I am not sure whether blk_queue_max_sectors() should be changed, as it seems
      to be that way for a long time. And there may be callers dependent on that
      behaviour.
      
      This patch simply reverts to the older way of directly assigning the value to
      max_sectors as it was before.
      Signed-off-by: NNikanth Karthikesan <knikanth@suse.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c295fc05
  7. 05 8月, 2009 1 次提交
  8. 01 8月, 2009 4 次提交
  9. 29 7月, 2009 1 次提交
    • J
      block: make the end_io functions be non-GPL exports · 56ad1740
      Jens Axboe 提交于
      Prior to the change for more sane end_io functions, we exported
      the helpers with the normal EXPORT_SYMBOL(). That got changed
      to _GPL() for the new interface. Revert that particular change,
      on the basis that this is basic functionality and doesn't dip
      into internal structures. If these exports can't be non-GPL,
      then we may as well make EXPORT_SYMBOL() imply GPL for
      everything.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      56ad1740
  10. 28 7月, 2009 2 次提交
  11. 17 7月, 2009 1 次提交