1. 21 10月, 2008 7 次提交
  2. 20 10月, 2008 1 次提交
    • P
      x86: sysfs: kill owner field from attribute · 01e8ef11
      Parag Warudkar 提交于
      Tejun's commit 7b595756 made sysfs
      attribute->owner unnecessary.  But the field was left in the structure to
      ease the merge.  It's been over a year since that change and it is now
      time to start killing attribute->owner along with its users - one arch at
      a time!
      
      This patch is attempt #1 to get rid of attribute->owner only for
      CONFIG_X86_64 or CONFIG_X86_32 .  We will deal with other arches later on
      as and when possible - avr32 will be the next since that is something I
      can test.  Compile (make allyesconfig / make allmodconfig / custom config)
      and boot tested.
      
      akpm: the idea is that we put the declaration of sttribute.owner inside
      `#ifndef CONFIG_X86'.  But that proved to be too ambitious for now because
      new usages kept on turning up in subsystem trees.
      
      [akpm: remove the ifdef for now]
      Signed-off-by: NParag Warudkar <parag.lkml@gmail.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      01e8ef11
  3. 18 10月, 2008 1 次提交
  4. 17 10月, 2008 1 次提交
  5. 15 10月, 2008 1 次提交
  6. 11 10月, 2008 1 次提交
  7. 09 10月, 2008 15 次提交
    • D
      block: mark bio_split_pool static · 6feef531
      Denis ChengRq 提交于
      Since all bio_split calls refer the same single bio_split_pool, the bio_split
      function can use bio_split_pool directly instead of the mempool_t parameter;
      
      then the mempool_t parameter can be removed from bio_split param list, and
      bio_split_pool is only referred in fs/bio.c file, can be marked static.
      Signed-off-by: NDenis ChengRq <crquan@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6feef531
    • K
      virtio_blk: change to use __blk_end_request() · 8316982a
      Kiyoshi Ueda 提交于
      This patch converts virtio_blk to use __blk_end_request() directly
      so that end_{queued|dequeued}_request() can be removed.
      Related 'uptodate' argument is converted to 'error'.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      8316982a
    • K
      floppy: support arbitrary first-sector numbers · 9e49184c
      Keith Wansbrough 提交于
      The current floppy_struct allows floppies to number sectors starting
      from 0 or 1.  This patch allows arbitrary first-sector numbers - for
      example, 0xC1 for Amstrad CPC disks.
      
      This extends the existing 1-bit field (FD_ZEROBASED, bit 2 of stretch)
      to 8 bits (FD_SECTMASK, bits 2 to 9).
      
      Currently 0x00 denotes a first sector number of 1, and 0x01 denotes a
      first sector number of 0.  We extend this by interpreting FD_SECTMASK
      as the first sector number with the LSB flipped.
      Signed-off-by: NKeith Wansbrough <keith@lochan.org>
      Cc: Alain Knaff <alain@linux.lu>
      Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
      Cc: Karel Zak <kzak@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9e49184c
    • J
      drivers/block: Use DIV_ROUND_UP · 061837bc
      Julia Lawall 提交于
      The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
      (d)) but is perhaps more readable.
      
      An extract of the semantic patch that makes this change is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @haskernel@
      @@
      
      #include <linux/kernel.h>
      
      @depends on haskernel@
      expression n,d;
      @@
      
      (
      - (n + d - 1) / d
      + DIV_ROUND_UP(n,d)
      |
      - (n + (d - 1)) / d
      + DIV_ROUND_UP(n,d)
      )
      
      @depends on haskernel@
      expression n,d;
      @@
      
      - DIV_ROUND_UP((n),d)
      + DIV_ROUND_UP(n,d)
      
      @depends on haskernel@
      expression n,d;
      @@
      
      - DIV_ROUND_UP(n,(d))
      + DIV_ROUND_UP(n,d)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Cc: <mike.miller@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      061837bc
    • S
      cciss: Fix cciss SCSI rescan code to better notice device changes · 905bd78f
      scameron@beardog.cca.cpqcorp.net 提交于
      Fix cciss SCSI rescan code to better notice device changes.
      If you hot-unplug a tape drive, then hot-plug a different
      tape drive into the same slot in a storage enclosure,
      the cciss driver wouldn't notice anything had changed, as
      it was only looking at the LUN address and device type.
      Now it looks at the inquiry page 0x83 device identifier,
      and vendor and model strings as well.
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      905bd78f
    • C
      block: Expand Xen blkfront for > 16 xvd · 9246b5f0
      Chris Lalancette 提交于
      Until recently, the maximum number of xvd block devices you could attach
      to a Xen domU was 16. This limitation turned out to be problematic for
      some users, so it was expanded to handle a much larger number of disks.
      However, this requires a couple of changes in the way that blkfront
      scans for disks. This functionality is already present in the Xen
      linux-2.6.18-xen.hg tree; the attached patch adds this functionality to
      the mainline xen-blkfront implementation. I successfully tested it on a
      2.6.25 tree, and build tested it on 2.6.27-rc3.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      Acked-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9246b5f0
    • T
      block: move stats from disk to part0 · 074a7aca
      Tejun Heo 提交于
      Move stats related fields - stamp, in_flight, dkstats - from disk to
      part0 and unify stat handling such that...
      
      * part_stat_*() now updates part0 together if the specified partition
        is not part0.  ie. part_stat_*() are now essentially all_stat_*().
      
      * {disk|all}_stat_*() are gone.
      
      * part_round_stats() is updated similary.  It handles part0 stats
        automatically and disk_round_stats() is killed.
      
      * part_{inc|dec}_in_fligh() is implemented which automatically updates
        part0 stats for parts other than part0.
      
      * disk_map_sector_rcu() is updated to return part0 if no part matches.
        Combined with the above changes, this makes NULL special case
        handling in callers unnecessary.
      
      * Separate stats show code paths for disk are collapsed into part
        stats show code paths.
      
      * Rename disk_stat_lock/unlock() to part_stat_lock/unlock()
      
      While at it, reposition stat handling macros a bit and add missing
      parentheses around macro parameters.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      074a7aca
    • T
      block: move capacity from disk to part0 · 80795aef
      Tejun Heo 提交于
      Move disk->capacity to part0->nr_sects and convert all users who
      directly accessed the field to use {get|set}_capacity().  This is done
      early to allow the __dev field to be moved.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      80795aef
    • 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 diskstats access · c9959059
      Tejun Heo 提交于
      There are two variants of stat functions - ones prefixed with double
      underbars which don't care about preemption and ones without which
      disable preemption before manipulating per-cpu counters.  It's unclear
      whether the underbarred ones assume that preemtion is disabled on
      entry as some callers don't do that.
      
      This patch unifies diskstats access by implementing disk_stat_lock()
      and disk_stat_unlock() which take care of both RCU (for partition
      access) and preemption (for per-cpu counter access).  diskstats access
      should always be enclosed between the two functions.  As such, there's
      no need for the versions which disables preemption.  They're removed
      and double underbars ones are renamed to drop the underbars.  As an
      extra argument is added, there's no danger of using the old version
      unconverted.
      
      disk_stat_lock() uses get_cpu() and returns the cpu index and all
      diskstat functions which access per-cpu counters now has @cpu
      argument to help RT.
      
      This change adds RCU or preemption operations at some places but also
      collapses several preemption ops into one at others.  Overall, the
      performance difference should be negligible as all involved ops are
      very lightweight per-cpu ones.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c9959059
    • 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: misc updates · 310a2c10
      Tejun Heo 提交于
      This patch makes the following misc updates in preparation for
      disk->part dereference fix and extended block devt support.
      
      * implment part_to_disk()
      
      * fix comment about gendisk->part indexing
      
      * rename get_part() to disk_map_sector()
      
      * don't use n which is always zero while printing disk information in
        diskstats_show()
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      310a2c10
    • F
      virtio_blk: use a wrapper function to access io context information of IO requests · 766ca442
      Fernando Luis Vázquez Cao 提交于
      struct request has an ioprio member but it is never updated because
      currently bios do not hold io context information. The implication of
      this is that virtio_blk ends up passing useless information to the
      backend driver.
      
      That said, some IO schedulers such as CFQ do store io context
      information in struct request, but use private members for that, which
      means that that information cannot be directly accessed in a IO
      scheduler-independent way.
      
      This patch adds a function to obtain the ioprio of a request. We should
      avoid accessing ioprio directly and use this function instead, so that
      its users do not have to care about future changes in block layer
      structures or what the currently active IO controller is.
      
      This patch does not introduce any functional changes but paves the way
      for future clean-ups and enhancements.
      Signed-off-by: NFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      766ca442
    • D
      Kill REQ_TYPE_FLUSH · 1a8e2bdd
      David Woodhouse 提交于
      It was only used by ps3disk, and it should probably have been
      REQ_TYPE_LINUX_BLOCK + REQ_LB_OP_FLUSH.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      1a8e2bdd
  8. 07 10月, 2008 1 次提交
  9. 24 9月, 2008 1 次提交
  10. 23 9月, 2008 1 次提交
  11. 22 9月, 2008 1 次提交
  12. 01 9月, 2008 1 次提交
  13. 28 8月, 2008 1 次提交
  14. 21 8月, 2008 2 次提交
  15. 20 8月, 2008 1 次提交
  16. 06 8月, 2008 4 次提交