1. 21 4月, 2008 13 次提交
    • N
      Kconfig: clean up block/Kconfig help descriptions · ee86418d
      Nick Andrew 提交于
      Modify the help descriptions of block/Kconfig for clarity, accuracy and
      consistency.
      
      Refactor the BLOCK description a bit.  The wording "This permits ...  to be
      removed" isn't quite right; the block layer is removed when the option is
      disabled, whereas most descriptions talk about what happens when the option is
      enabled.  Reformat the list of what is affected by disabling the block layer.
      
      Add more examples of large block devices to LBD and strive for technical
      accuracy; block devices of size _exactly_ 2TB require CONFIG_LBD, not only
      "bigger than 2TB".  Also try to say (perhaps not very clearly) that the config
      option is only needed when you want to have individual block devices of size
      >= 2TB, for example if you had 3 x 1TB disks in your computer you'd have a
      total storage size of 3TB but you wouldn't need the option unless you want to
      aggregate those disks into a RAID or LVM.
      
      Improve terminology and grammar on BLK_DEV_IO_TRACE.
      
      I also added the boilerplate "If unsure, say N" to most options.
      
      Precisely say "2TB and larger" for LSF.
      
      Indent the help text for BLK_DEV_BSG by 2 spaces in accordance with the
      standard.
      Signed-off-by: NNick Andrew <nick@nick-andrew.net>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ee86418d
    • S
      cciss: fix warning oops on rmmod of driver · 6195057f
      scameron@beardog.cca.cpqcorp.net 提交于
      * Fix oops on cciss rmmod due to calling pci_free_consistent with
        irqs disabled.
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6195057f
    • S
      cciss: Fix race between disk-adding code and interrupt handler · e14ac670
      scameron@beardog.cca.cpqcorp.net 提交于
      Fix race condition between cciss_init_one(), cciss_update_drive_info(),
      and cciss_check_queues().
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e14ac670
    • F
      block: move the padding adjustment to blk_rq_map_sg · f18573ab
      FUJITA Tomonori 提交于
      blk_rq_map_user adjusts bi_size of the last bio. It breaks the rule
      that req->data_len (the true data length) is equal to sum(bio). It
      broke the scsi command completion code.
      
      commit e97a294e was introduced to fix
      the above issue. However, the partial completion code doesn't work
      with it. The commit is also a layer violation (scsi mid-layer should
      not know about the block layer's padding).
      
      This patch moves the padding adjustment to blk_rq_map_sg (suggested by
      James). The padding works like the drain buffer. This patch breaks the
      rule that req->data_len is equal to sum(sg), however, the drain buffer
      already broke it. So this patch just restores the rule that
      req->data_len is equal to sub(bio) without breaking anything new.
      
      Now when a low level driver needs padding, blk_rq_map_user and
      blk_rq_map_user_iov guarantee there's enough room for padding.
      blk_rq_map_sg can safely extend the last entry of a scatter list.
      
      blk_rq_map_sg must extend the last entry of a scatter list only for a
      request that got through bio_copy_user_iov. This patches introduces
      new REQ_COPY_USER flag.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f18573ab
    • F
      block: add bio_copy_user_iov support to blk_rq_map_user_iov · afdc1a78
      FUJITA Tomonori 提交于
      With this patch, blk_rq_map_user_iov uses bio_copy_user_iov when a low
      level driver needs padding or a buffer in sg_iovec isn't aligned. That
      is, it uses temporary kernel buffers instead of mapping user pages
      directly.
      
      When a LLD needs padding, later blk_rq_map_sg needs to extend the last
      entry of a scatter list. bio_copy_user_iov guarantees that there is
      enough space for padding by using temporary kernel buffers instead of
      user pages.
      
      blk_rq_map_user_iov needs buffers in sg_iovec to be aligned. The
      comment in blk_rq_map_user_iov indicates that drivers/scsi/sg.c also
      needs buffers in sg_iovec to be aligned. Actually, drivers/scsi/sg.c
      works with unaligned buffers in sg_iovec (it always uses temporary
      kernel buffers).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      afdc1a78
    • F
      block: convert bio_copy_user to bio_copy_user_iov · c5dec1c3
      FUJITA Tomonori 提交于
      This patch enables bio_copy_user to take struct sg_iovec (renamed
      bio_copy_user_iov). bio_copy_user uses bio_copy_user_iov internally as
      bio_map_user uses bio_map_user_iov.
      
      The major changes are:
      
      - adds sg_iovec array to struct bio_map_data
      
      - adds __bio_copy_iov that copy data between bio and
      sg_iovec. bio_copy_user_iov and bio_uncopy_user use it.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c5dec1c3
    • L
      loop: manage partitions in disk image · 476a4813
      Laurent Vivier 提交于
      This patch allows to use loop device with partitionned disk image.
      
      Original behavior of loop is not modified.
      
      A new parameter is introduced to define how many partition we want to be
      able to manage per loop device. This parameter is "max_part".
      
      For instance, to manage 63 partitions / loop device, we will do:
      # modprobe loop max_part=63
      # ls -l /dev/loop?*
      brw-rw---- 1 root disk 7,   0 2008-03-05 14:55 /dev/loop0
      brw-rw---- 1 root disk 7,  64 2008-03-05 14:55 /dev/loop1
      brw-rw---- 1 root disk 7, 128 2008-03-05 14:55 /dev/loop2
      brw-rw---- 1 root disk 7, 192 2008-03-05 14:55 /dev/loop3
      brw-rw---- 1 root disk 7, 256 2008-03-05 14:55 /dev/loop4
      brw-rw---- 1 root disk 7, 320 2008-03-05 14:55 /dev/loop5
      brw-rw---- 1 root disk 7, 384 2008-03-05 14:55 /dev/loop6
      brw-rw---- 1 root disk 7, 448 2008-03-05 14:55 /dev/loop7
      
      And to attach a raw partitionned disk image, the original losetup is used:
      
      # losetup -f etch.img
      # ls -l /dev/loop?*
      brw-rw---- 1 root disk 7,   0 2008-03-05 14:55 /dev/loop0
      brw-rw---- 1 root disk 7,   1 2008-03-05 14:57 /dev/loop0p1
      brw-rw---- 1 root disk 7,   2 2008-03-05 14:57 /dev/loop0p2
      brw-rw---- 1 root disk 7,   5 2008-03-05 14:57 /dev/loop0p5
      brw-rw---- 1 root disk 7,  64 2008-03-05 14:55 /dev/loop1
      brw-rw---- 1 root disk 7, 128 2008-03-05 14:55 /dev/loop2
      brw-rw---- 1 root disk 7, 192 2008-03-05 14:55 /dev/loop3
      brw-rw---- 1 root disk 7, 256 2008-03-05 14:55 /dev/loop4
      brw-rw---- 1 root disk 7, 320 2008-03-05 14:55 /dev/loop5
      brw-rw---- 1 root disk 7, 384 2008-03-05 14:55 /dev/loop6
      brw-rw---- 1 root disk 7, 448 2008-03-05 14:55 /dev/loop7
      # mount /dev/loop0p1 /mnt
      # ls /mnt
      bench  cdrom  home        lib         mnt   root     srv  usr
      bin    dev    initrd      lost+found  opt   sbin     sys  var
      boot   etc    initrd.img  media       proc  selinux  tmp  vmlinuz
      # umount /mnt
      # losetup -d /dev/loop0
      
      Of course, the same behavior can be done using kpartx on a loop device,
      but modifying loop avoids to stack several layers of block device (loop +
      device mapper), this is a very light modification (40% of modifications
      are to manage the new parameter).
      Signed-off-by: NLaurent Vivier <Laurent.Vivier@bull.net>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      476a4813
    • T
      cdrom: use kmalloced buffers instead of buffers on stack · 22a9189f
      Thomas Bogendoerfer 提交于
      If cdrom commands are issued to a scsi drive in most cases the buffer will be
      filled via dma.  This leads to bad stack corruption on non coherent platforms,
      because the buffers are neither cache line aligned nor is the size a multiple
      of the cache line size.  Using kmalloced buffers avoids this.
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      22a9189f
    • A
      cdrom: make unregister_cdrom() return void · 0a0c4114
      Akinobu Mita 提交于
      Now unregister_cdrom() always returns 0.
      Make it return void and update all callers that check the return value.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0a0c4114
    • A
      cdrom: use list_head for cdrom_device_info list · 7fd097d4
      Akinobu Mita 提交于
      Use list_head for cdrom_device_info list instead of opencoded
      singly list handling.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      7fd097d4
    • A
      cdrom: protect cdrom_device_info list by mutex · 032d8d90
      Akinobu Mita 提交于
      This patch protects the list of cdrom_device_info by cdrom_mutex
      when the file in /proc/sys/dev/cdrom/ is written.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      032d8d90
    • A
      cdrom: cleanup hardcoded error-code · 3c3f4e01
      Akinobu Mita 提交于
      This patch eliminates hardcoded return value of register_cdrom().
      
      It also changes the return value to -EINVAL.
      It is more appropriate than -2 (-ENOENT) because it is only
      happen invalid usage of register_cdrom() by broken cdrom driver.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      3c3f4e01
    • A
      cdrom: remove ifdef CONFIG_SYSCTL · 17672cf0
      Akinobu Mita 提交于
      This patch removes #ifdef for CONFIG_SYSCTL by defining empty
      cdrom_sysctl_register and cdrom_sysctl_unregister when CONFIG_SYSCTL
      is not defined.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      17672cf0
  2. 19 4月, 2008 27 次提交