1. 01 7月, 2009 1 次提交
    • J
      block: get rid of queue-private command filter · 018e0446
      Jens Axboe 提交于
      The initial patches to support this through sysfs export were broken
      and have been if 0'ed out in any release. So lets just kill the code
      and reclaim some space in struct request_queue, if anyone would later
      like to fixup the sysfs bits, the git history can easily restore
      the removed bits.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      018e0446
  2. 21 6月, 2009 1 次提交
  3. 16 6月, 2009 1 次提交
  4. 09 6月, 2009 1 次提交
  5. 11 5月, 2009 1 次提交
    • T
      block: add rq->resid_len · c3a4d78c
      Tejun Heo 提交于
      rq->data_len served two purposes - the length of data buffer on issue
      and the residual count on completion.  This duality creates some
      headaches.
      
      First of all, block layer and low level drivers can't really determine
      what rq->data_len contains while a request is executing.  It could be
      the total request length or it coulde be anything else one of the
      lower layers is using to keep track of residual count.  This
      complicates things because blk_rq_bytes() and thus
      [__]blk_end_request_all() relies on rq->data_len for PC commands.
      Drivers which want to report residual count should first cache the
      total request length, update rq->data_len and then complete the
      request with the cached data length.
      
      Secondly, it makes requests default to reporting full residual count,
      ie. reporting that no data transfer occurred.  The residual count is
      an exception not the norm; however, the driver should clear
      rq->data_len to zero to signify the normal cases while leaving it
      alone means no data transfer occurred at all.  This reverse default
      behavior complicates code unnecessarily and renders block PC on some
      drivers (ide-tape/floppy) unuseable.
      
      This patch adds rq->resid_len which is used only for residual count.
      
      While at it, remove now unnecessasry blk_rq_bytes() caching in
      ide_pc_intr() as rq->data_len is not changed anymore.
      
      Boaz	: spotted missing conversion in osd
      Sergei	: spotted too early conversion to blk_rq_bytes() in ide-tape
      
      [ Impact: cleanup residual count handling, report 0 resid by default ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c3a4d78c
  6. 26 3月, 2009 1 次提交
  7. 24 3月, 2009 1 次提交
    • B
      bsg: add support for tail queuing · 05378940
      Boaz Harrosh 提交于
      Currently inherited from sg.c bsg will submit asynchronous request
       at the head-of-the-queue, (using "at_head" set in the call to
       blk_execute_rq_nowait()). This is bad in situation where the queues
       are full, requests will execute out of order, and can cause
       starvation of the first submitted requests.
      
      The sg_io_v4->flags member is used and a bit is allocated to denote the
      Q_AT_TAIL. Zero is to queue at_head as before, to be compatible with old
      code at the write/read path. SG_IO code path behavior was changed so to
      be the same as write/read behavior. SG_IO was very rarely used and breaking
      compatibility with it is OK at this stage.
      
      sg_io_hdr at sg.h also has a flags member and uses 3 bits from the first
      nibble and one bit from the last nibble. Even though none of these bits
      are supported by bsg, The second nibble is allocated for use by bsg. Just
      in case.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      CC: Douglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      05378940
  8. 18 2月, 2009 1 次提交
    • B
      bsg: Fix sense buffer bug in SG_IO · c1c20120
      Boaz Harrosh 提交于
      When submitting requests via SG_IO, which does a sync io, a
      bsg_command is not allocated. So an in-Kernel sense_buffer was not
      set. However when calling blk_execute_rq() with no sense buffer
      one is provided from the stack. Now bsg at blk_complete_sgv4_hdr_rq()
      would check if rq->sense_len and a sense was requested by sg_io_v4
      the rq->sense was copy_user() back, but by now it is already mangled
      stack memory.
      
      I have fixed that by forcing a sense_buffer when calling bsg_map_hdr().
      The bsg_command->sense is provided in the write/read path like before,
      and on-the-stack buffer is provided when doing SG_IO.
      
      I have also fixed a dprintk message to print rq->errors in hex because
      of the scsi bit-field use of this member. For other block devices it
      does not matter anyway.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Acked-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c1c20120
  9. 07 1月, 2009 1 次提交
  10. 06 12月, 2008 1 次提交
  11. 21 10月, 2008 2 次提交
  12. 17 10月, 2008 1 次提交
  13. 09 10月, 2008 2 次提交
  14. 27 8月, 2008 1 次提交
    • F
      block: move cmdfilter from gendisk to request_queue · abf54393
      FUJITA Tomonori 提交于
      cmd_filter works only for the block layer SG_IO with SCSI block
      devices. It breaks scsi/sg.c, bsg, and the block layer SG_IO with SCSI
      character devices (such as st). We hit a kernel crash with them.
      
      The problem is that cmd_filter code accesses to gendisk (having struct
      blk_scsi_cmd_filter) via inode->i_bdev->bd_disk. It works for only
      SCSI block device files. With character device files, inode->i_bdev
      leads you to struct cdev. inode->i_bdev->bd_disk->blk_scsi_cmd_filter
      isn't safe.
      
      SCSI ULDs don't expose gendisk; they keep it private. bsg needs to be
      independent on any protocols. We shouldn't change ULDs to expose their
      gendisk.
      
      This patch moves struct blk_scsi_cmd_filter from gendisk to
      request_queue, a common object, which eveyone can access to.
      
      The user interface doesn't change; users can change the filters via
      /sys/block/. gendisk has a pointer to request_queue so the cmd_filter
      code accesses to struct blk_scsi_cmd_filter.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      abf54393
  15. 22 7月, 2008 1 次提交
  16. 12 7月, 2008 2 次提交
  17. 03 7月, 2008 1 次提交
  18. 19 5月, 2008 1 次提交
  19. 02 5月, 2008 1 次提交
  20. 01 5月, 2008 1 次提交
  21. 23 4月, 2008 1 次提交
    • F
      [SCSI] bsg: add release callback support · 97f46ae4
      FUJITA Tomonori 提交于
      This patch adds release callback support, which is called when a bsg
      device goes away. bsg_register_queue() takes a pointer to a callback
      function. This feature is useful for stuff like sas_host that can't
      use the release callback in struct device.
      
      If a caller doesn't need bsg's release callback, it can call
      bsg_register_queue() with NULL pointer (e.g. scsi devices can use
      release callback in struct device so they don't need bsg's callback).
      
      With this patch, bsg uses kref for refcounts on bsg devices instead of
      get/put_device in fops->open/release. bsg calls put_device and the
      caller's release callback (if it was registered) in kref_put's
      release.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      97f46ae4
  22. 20 4月, 2008 1 次提交
  23. 19 4月, 2008 5 次提交
  24. 04 3月, 2008 1 次提交
    • F
      block: restore the meaning of rq->data_len to the true data length · 7a85f889
      FUJITA Tomonori 提交于
      The meaning of rq->data_len was changed to the length of an allocated
      buffer from the true data length. It breaks SG_IO friends and
      bsg. This patch restores the meaning of rq->data_len to the true data
      length and adds rq->extra_len to store an extended length (due to
      drain buffer and padding).
      
      This patch also removes the code to update bio in blk_rq_map_user
      introduced by the commit 40b01b9b.
      The commit adjusts bio according to memory alignment
      (queue_dma_alignment). However, memory alignment is NOT padding
      alignment. This adjustment also breaks SG_IO friends and bsg. Padding
      alignment needs to be fixed in a proper way (by a separate patch).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <axboe@carl.home.kernel.dk>
      7a85f889
  25. 19 2月, 2008 1 次提交
    • T
      block: add request->raw_data_len · 6b00769f
      Tejun Heo 提交于
      With padding and draining moved into it, block layer now may extend
      requests as directed by queue parameters, so now a request has two
      sizes - the original request size and the extended size which matches
      the size of area pointed to by bios and later by sgs.  The latter size
      is what lower layers are primarily interested in when allocating,
      filling up DMA tables and setting up the controller.
      
      Both padding and draining extend the data area to accomodate
      controller characteristics.  As any controller which speaks SCSI can
      handle underflows, feeding larger data area is safe.
      
      So, this patch makes the primary data length field, request->data_len,
      indicate the size of full data area and add a separate length field,
      request->raw_data_len, for the unmodified request size.  The latter is
      used to report to higher layer (userland) and where the original
      request size should be fed to the controller or device.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6b00769f
  26. 31 1月, 2008 1 次提交
  27. 12 1月, 2008 1 次提交
  28. 16 10月, 2007 1 次提交
  29. 13 10月, 2007 1 次提交
  30. 31 7月, 2007 1 次提交
  31. 24 7月, 2007 3 次提交