Skip to content
Snippets Groups Projects
  1. Jul 26, 2011
  2. Jun 10, 2011
  3. May 17, 2011
  4. May 10, 2011
  5. May 01, 2011
  6. Apr 26, 2011
  7. Apr 21, 2011
    • Tejun Heo's avatar
      block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers · 9fd097b1
      Tejun Heo authored
      
      In-kernel disk event polling doesn't matter for legacy/fringe drivers
      and may lead to infinite event loop if ->check_events() implementation
      generates events on level condition instead of edge.
      
      Now that block layer supports suppressing exporting unlisted events,
      simply leaving disk->events cleared allows these drivers to keep the
      internal revalidation behavior intact while avoiding weird
      interactions with userland event handler.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      9fd097b1
  8. Mar 31, 2011
  9. Mar 17, 2011
  10. Mar 10, 2011
  11. Mar 09, 2011
    • Tejun Heo's avatar
      i2o_block: Convert to bdops->check_events() · f47350fd
      Tejun Heo authored
      
      Convert from ->media_changed() to ->check_events().
      
      i2o_block buffers media changed state and clears it after reporting.
      It will behave correctly with kernel event polling.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      f47350fd
  12. Feb 12, 2011
  13. Feb 01, 2011
  14. Jan 24, 2011
  15. Jan 19, 2011
  16. Nov 16, 2010
    • Jeff Garzik's avatar
      SCSI host lock push-down · f281233d
      Jeff Garzik authored
      
      Move the mid-layer's ->queuecommand() invocation from being locked
      with the host lock to being unlocked to facilitate speeding up the
      critical path for drivers who don't need this lock taken anyway.
      
      The patch below presents a simple SCSI host lock push-down as an
      equivalent transformation.  No locking or other behavior should change
      with this patch.  All existing bugs and locking orders are preserved.
      
      Additionally, add one parameter to queuecommand,
      	struct Scsi_Host *
      and remove one parameter from queuecommand,
      	void (*done)(struct scsi_cmnd *)
      
      Scsi_Host* is a convenient pointer that most host drivers need anyway,
      and 'done' is redundant to struct scsi_cmnd->scsi_done.
      
      Minimal code disturbance was attempted with this change.  Most drivers
      needed only two one-line modifications for their host lock push-down.
      
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Acked-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f281233d
  17. Nov 01, 2010
  18. Oct 05, 2010
    • Arnd Bergmann's avatar
      block: autoconvert trivial BKL users to private mutex · 2a48fc0a
      Arnd Bergmann authored
      
      The block device drivers have all gained new lock_kernel
      calls from a recent pushdown, and some of the drivers
      were already using the BKL before.
      
      This turns the BKL into a set of per-driver mutexes.
      Still need to check whether this is safe to do.
      
      file=$1
      name=$2
      if grep -q lock_kernel ${file} ; then
          if grep -q 'include.*linux.mutex.h' ${file} ; then
                  sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
          else
                  sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
          fi
          sed -i ${file} \
              -e "/^#include.*linux.mutex.h/,$ {
                      1,/^\(static\|int\|long\)/ {
                           /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);
      
      } }"  \
          -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
          -e '/[      ]*cycle_kernel_lock();/d'
      else
          sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                      -e '/cycle_kernel_lock()/d'
      fi
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      2a48fc0a
  19. Sep 15, 2010
    • Arnd Bergmann's avatar
      scsi: autoconvert trivial BKL users to private mutex · c45d15d2
      Arnd Bergmann authored
      
      All these files use the big kernel lock in a trivial
      way to serialize their private file operations,
      typically resulting from an earlier semi-automatic
      pushdown from VFS.
      
      None of these drivers appears to want to lock against
      other code, and they all use the BKL as the top-level
      lock in their file operations, meaning that there
      is no lock-order inversion problem.
      
      Consequently, we can remove the BKL completely,
      replacing it with a per-file mutex in every case.
      Using a scripted approach means we can avoid
      typos.
      
      file=$1
      name=$2
      if grep -q lock_kernel ${file} ; then
          if grep -q 'include.*linux.mutex.h' ${file} ; then
                  sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
          else
                  sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
          fi
          sed -i ${file} \
              -e "/^#include.*linux.mutex.h/,$ {
                      1,/^\(static\|int\|long\)/ {
                           /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);
      
      } }"  \
          -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
          -e '/[      ]*cycle_kernel_lock();/d'
      else
          sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                      -e '/cycle_kernel_lock()/d'
      fi
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: linux-scsi@vger.kernel.org
      Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
      c45d15d2
  20. Sep 05, 2010
  21. Aug 14, 2010
  22. Aug 11, 2010
  23. Aug 10, 2010
  24. Aug 07, 2010
    • Arnd Bergmann's avatar
      scsi/i2o: restore ioctl changes · 2daa672b
      Arnd Bergmann authored
      
      This restores the changes from "scsi/i2o_block: cleanup ioctl
      handling", which accidentally got reverted.
      
      Origignal changelog:
            This fixes the ioctl function of the i2o_block driver, which
            has multiple problems:
      
            * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return
              -ENOTTY on success, where they should return 0.
            * Support for 32 bit compat is missing
            * The driver should use the .ioctl function and because
              .locked_ioctl is going away.
      
            The use of the big kernel lock remains for now, but gets
            made explictit in the ioctl function.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      2daa672b
    • Arnd Bergmann's avatar
      block: push down BKL into .open and .release · 6e9624b8
      Arnd Bergmann authored
      
      The open and release block_device_operations are currently
      called with the BKL held. In order to change that, we must
      first make sure that all drivers that currently rely
      on this have no regressions.
      
      This blindly pushes the BKL into all .open and .release
      operations for all block drivers to prepare for the
      next step. The drivers can subsequently replace the BKL
      with their own locks or remove it completely when it can
      be shown that it is not needed.
      
      The functions blkdev_get and blkdev_put are the only
      remaining users of the big kernel lock in the block
      layer, besides a few uses in the ioctl code, none
      of which need to serialize with blkdev_{get,put}.
      
      Most of these two functions is also under the protection
      of bdev->bd_mutex, including the actual calls to
      ->open and ->release, and the common code does not
      access any global data structures that need the BKL.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      6e9624b8
Loading