1. 23 10月, 2008 1 次提交
  2. 21 10月, 2008 8 次提交
  3. 17 10月, 2008 1 次提交
    • R
      block: fix current kernel-doc warnings · 496aa8a9
      Randy Dunlap 提交于
      Fix block kernel-doc warnings:
      
      Warning(linux-2.6.27-git4//fs/block_dev.c:1272): No description found for parameter 'path'
      Warning(linux-2.6.27-git4//block/blk-core.c:1021): No description found for parameter 'cpu'
      Warning(linux-2.6.27-git4//block/blk-core.c:1021): No description found for parameter 'part'
      Warning(/var/linsrc/linux-2.6.27-git4//block/genhd.c:544): No description found for parameter 'partno'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      496aa8a9
  4. 09 10月, 2008 12 次提交
    • R
      block_dev: fix kernel-doc in new functions · 57d1b536
      Randy Dunlap 提交于
      Fix kernel-doc in new functions:
      
      Error(mmotm-2008-1002-1617//fs/block_dev.c:895): duplicate section name 'Description'
      Error(mmotm-2008-1002-1617//fs/block_dev.c:924): duplicate section name 'Description'
      Warning(mmotm-2008-1002-1617//fs/block_dev.c:1282): No description found for parameter 'pathname'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      cc: Andrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      57d1b536
    • A
      Call flush_disk() after detecting an online resize. · 608aeef1
      Andrew Patterson 提交于
      We call flush_disk() to make sure the buffer cache for the disk is
      flushed after a disk resize. There are two resize cases, growing and
      shrinking. Given that users can shrink/then grow a disk before
      revalidate_disk() is called, we treat the grow case identically to
      shrinking. We need to flush the buffer cache after an online shrink
      because, as James Bottomley puts it,
      
           The two use cases for shrinking I can see are
      
           1. planned: the fs is already shrunk to within the new boundaries
              and all data is relocated, so invalidate is fine (any dirty
              buffers that might exist in the shrunk region are there only
              because they were relocated but not yet written to their
              original location).
           2. unplanned:  In this case, the fs is probably toast, so whether
              we invalidate or not isn't going to make a whole lot of
              difference; it's still going to try to read or write from
              sectors beyond the new size and get I/O errors.
      
      Immediately invalidating shrunk disks will cause errors for outstanding
      I/Os for reads/write beyond the new end of the disk to be generated
      earlier then if we waited for the normal buffer cache operation. It also
      removes a potential security hole where we might keep old data around
      from beyond the end of the shrunk disk if the disk was not invalidated.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      608aeef1
    • A
      Added flush_disk to factor out common buffer cache flushing code. · 56ade44b
      Andrew Patterson 提交于
      We need to be able to flush the buffer cache for for more than
      just when a disk is changed, so we factor out common cache flush code
      in check_disk_change() to an internal flush_disk() routine.  This
      routine will then be used for both disk changes and disk resizes (in a
      later patch).
      
      Include the disk name in the text indicating that there are busy
      inodes on the device and increase the KERN severity of the message.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      56ade44b
    • A
      Adjust block device size after an online resize of a disk. · c3279d14
      Andrew Patterson 提交于
      The revalidate_disk routine now checks if a disk has been resized by
      comparing the gendisk capacity to the bdev inode size.  If they are
      different (usually because the disk has been resized underneath the kernel)
      the bdev inode size is adjusted to match the capacity.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c3279d14
    • A
      Wrapper for lower-level revalidate_disk routines. · 0c002c2f
      Andrew Patterson 提交于
      This is a wrapper for the lower-level revalidate_disk call-backs such
      as sd_revalidate_disk(). It allows us to perform pre and post
      operations when calling them.
      
      We will use this wrapper in a later patch to adjust block device sizes
      after an online resize (a _post_ operation).
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0c002c2f
    • T
      block: always set bdev->bd_part · 0762b8bd
      Tejun Heo 提交于
      Till now, bdev->bd_part is set only if the bdev was for parts other
      than part0.  This patch makes bdev->bd_part always set so that code
      paths don't have to differenciate common handling.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0762b8bd
    • T
      block: move holder_dir from disk to part0 · 4c46501d
      Tejun Heo 提交于
      Move disk->holder_dir to part0->holder_dir.  Kill now mostly
      superflous bdev_get_holder().
      
      While at it, kill superflous kobject_get/put() around holder_dir,
      slave_dir and cmd_filter creation and collapse
      disk_sysfs_add_subdirs() into register_disk().  These serve no purpose
      but obfuscating the code.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      4c46501d
    • T
      block: introduce partition 0 · b5d0b9df
      Tejun Heo 提交于
      genhd and partition code handled disk and partitions separately.  All
      information about the whole disk was in struct genhd and partitions in
      struct hd_struct.  However, the whole disk (part0) and other
      partitions have a lot in common and the data structures end up having
      good number of common fields and thus separate code paths doing the
      same thing.  Also, the partition array was indexed by partno - 1 which
      gets pretty confusing at times.
      
      This patch introduces partition 0 and makes the partition array
      indexed by partno.  Following patches will unify the handling of disk
      and parts piece-by-piece.
      
      This patch also implements disk_partitionable() which tests whether a
      disk is partitionable.  With coming dynamic partition array change,
      the most common usage of disk_max_parts() will be testing whether a
      disk is partitionable and the number of max partitions will become
      much less important.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      b5d0b9df
    • T
      block: implement and use {disk|part}_to_dev() · ed9e1982
      Tejun Heo 提交于
      Implement {disk|part}_to_dev() and use them to access generic device
      instead of directly dereferencing {disk|part}->dev.  To make sure no
      user is left behind, rename generic devices fields to __dev.
      
      This is in preparation of unifying partition 0 handling with other
      partitions.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ed9e1982
    • T
      block: fix disk->part[] dereferencing race · e71bf0d0
      Tejun Heo 提交于
      disk->part[] is protected by its matching bdev's lock.  However,
      non-critical accesses like collecting stats and printing out sysfs and
      proc information used to be performed without any locking.  As
      partitions can come and go dynamically, partitions can go away
      underneath those non-critical accesses.  As some of those accesses are
      writes, this theoretically can lead to silent corruption.
      
      This patch fixes the race by using RCU for the partition array and dev
      reference counter to hold partitions.
      
      * Rename disk->part[] to disk->__part[] to make sure no one outside
        genhd layer proper accesses it directly.
      
      * Use RCU for disk->__part[] dereferencing.
      
      * Implement disk_{get|put}_part() which can be used to get and put
        partitions from gendisk respectively.
      
      * Iterators are implemented to help iterate through all partitions
        safely.
      
      * Functions which require RCU readlock are marked with _rcu suffix.
      
      * Use disk_put_part() in __blkdev_put() instead of directly putting
        the contained kobject.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e71bf0d0
    • T
      block: don't depend on consecutive minor space · f331c029
      Tejun Heo 提交于
      * Implement disk_devt() and part_devt() and use them to directly
        access devt instead of computing it from ->major and ->first_minor.
      
        Note that all references to ->major and ->first_minor outside of
        block layer is used to determine devt of the disk (the part0) and as
        ->major and ->first_minor will continue to represent devt for the
        disk, converting these users aren't strictly necessary.  However,
        convert them for consistency.
      
      * Implement disk_max_parts() to avoid directly deferencing
        genhd->minors.
      
      * Update bdget_disk() such that it doesn't assume consecutive minor
        space.
      
      * Move devt computation from register_disk() to add_disk() and make it
        the only one (all other usages use the initially determined value).
      
      These changes clean up the code and will help disk->part dereference
      fix and extended block device numbers.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f331c029
    • T
      block: make variable and argument names more consistent · cf771cb5
      Tejun Heo 提交于
      In hd_struct, @partno is used to denote partition number and a number
      of other places use @part to denote hd_struct.  Functions use @part
      and @index instead.  This causes confusion and makes it difficult to
      use consistent variable names for hd_struct.  Always use @partno if a
      variable represents partition number.
      
      Also, print out functions use @f or @part for seq_file argument.  Use
      @seqf uniformly instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      cf771cb5
  5. 01 8月, 2008 2 次提交
  6. 27 7月, 2008 1 次提交
  7. 23 6月, 2008 1 次提交
  8. 07 6月, 2008 1 次提交
  9. 19 2月, 2008 2 次提交
    • A
      fs/block_dev.c: remove #if 0'ed code · 86b6c7a7
      Adrian Bunk 提交于
      Commit b2e895db #if 0'ed this code stating:
      
      <--  snip  -->
      
          [PATCH] revert blockdev direct io back to 2.6.19 version
      
          Andrew Vasquez is reporting as-iosched oopses and a 65% throughput
          slowdown due to the recent special-casing of direct-io against
          blockdevs.  We don't know why either of these things are occurring.
      
          The patch minimally reverts us back to the 2.6.19 code for a 2.6.20
          release.
      
      <--  snip  -->
      
      It has since been dead code, and unless someone wants to revive it now
      it's time to remove it.
      
      This patch also makes bio_release_pages() static again and removes the
      ki_bio_count member from struct kiocb, reverting changes that had been
      done for this dead code.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NJens Axboe <axboe@carl.home.kernel.dk>
      86b6c7a7
    • A
      make struct def_blk_aops static · 4c54ac62
      Adrian Bunk 提交于
      This patch makes the needlessly global struct def_blk_aops static.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NJens Axboe <axboe@carl.home.kernel.dk>
      4c54ac62
  10. 15 2月, 2008 2 次提交
  11. 07 2月, 2008 1 次提交
  12. 25 1月, 2008 1 次提交
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3
  13. 17 10月, 2007 2 次提交
  14. 10 10月, 2007 1 次提交
  15. 20 7月, 2007 1 次提交
    • P
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt 提交于
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      20c2df83
  16. 17 7月, 2007 3 次提交