1. 02 4月, 2009 1 次提交
  2. 10 3月, 2009 1 次提交
  3. 04 3月, 2009 1 次提交
  4. 19 2月, 2009 1 次提交
  5. 25 11月, 2008 1 次提交
  6. 21 10月, 2008 2 次提交
    • A
      [PATCH] switch aoeblk · 94562c17
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      94562c17
    • A
      [PATCH] beginning of methods conversion · d4430d62
      Al Viro 提交于
      To keep the size of changesets sane we split the switch by drivers;
      to keep the damn thing bisectable we do the following:
      	1) rename the affected methods, add ones with correct
      prototypes, make (few) callers handle both.  That's this changeset.
      	2) for each driver convert to new methods.  *ALL* drivers
      are converted in this series.
      	3) kill the old (renamed) methods.
      
      Note that it _is_ a flagday; all in-tree drivers are converted and by the
      end of this series no trace of old methods remain.  The only reason why
      we do that this way is to keep the damn thing bisectable and allow per-driver
      debugging if anything goes wrong.
      
      New methods:
      	open(bdev, mode)
      	release(disk, mode)
      	ioctl(bdev, mode, cmd, arg)		/* Called without BKL */
      	compat_ioctl(bdev, mode, cmd, arg)
      	locked_ioctl(bdev, mode, cmd, arg)	/* Called with BKL, legacy */
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d4430d62
  7. 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
  8. 17 10月, 2008 1 次提交
  9. 09 10月, 2008 6 次提交
    • 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: 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
  10. 24 9月, 2008 1 次提交
  11. 22 9月, 2008 1 次提交
  12. 02 8月, 2008 1 次提交
  13. 26 7月, 2008 1 次提交
  14. 22 7月, 2008 1 次提交
  15. 04 7月, 2008 1 次提交
  16. 21 6月, 2008 1 次提交
  17. 07 5月, 2008 1 次提交
  18. 29 4月, 2008 2 次提交
  19. 26 3月, 2008 1 次提交
  20. 09 2月, 2008 12 次提交
    • A
      aoe: statically initialise devlist_lock · 476aed38
      Andrew Morton 提交于
      I guess aoedev_init() can go away now.
      
      Cc: Greg KH <greg@kroah.com>
      Cc: "Ed L. Cashin" <ecashin@coraid.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      476aed38
    • E
      aoe: update copyright date · 52e112b3
      Ed L. Cashin 提交于
      Update the year in the copyright notices.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      52e112b3
    • E
      aoe: make error messages more specific · 578c4aa0
      Ed L. Cashin 提交于
      Andrew Morton pointed out that the "too many targets" message in patch 2 could
      be printed for failing GFP_ATOMIC allocations.  This patch makes the messages
      more specific.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      578c4aa0
    • E
      aoe: the aoeminor doesn't need a long format · 1d75981a
      Ed L. Cashin 提交于
      The aoedev aoeminor member doesn't need a long format.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d75981a
    • E
      aoe: add module parameter for users who need more outstanding I/O · 7df620d8
      Ed L. Cashin 提交于
      An AoE target provides an estimate of the number of outstanding commands that
      the AoE initiator can send before getting a response.  The aoe_maxout
      parameter provides a way to set an even lower limit.  It will not allow a user
      to use more outstanding commands than the target permits.  If a user discovers
      a problem with a large setting, this parameter provides a way for us to work
      with them to debug the problem.  We expect to improve the dynamic window
      sizing algorithm and drop this parameter.  For the time being, it is a
      debugging aid.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7df620d8
    • E
      aoe: only install new AoE device once · 6b9699bb
      Ed L. Cashin 提交于
      An aoe driver user who had about 70 AoE targets found that he was hitting a
      BUG in sysfs_create_file because the aoe driver was trying to tell the kernel
      about an AoE device more than once.  Each AoE device was reachable by several
      local network interfaces, and multiple ATA device indentify responses were
      returning from that single device.
      
      This patch eliminates a race condition so that aoe always informs the block
      layer of a new AoE device once in the presence of multiple incoming ATA device
      identify responses.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6b9699bb
    • E
      aoe: dynamically allocate a capped number of skbs when necessary · 9bb237b6
      Ed L. Cashin 提交于
      What this Patch Does
      
        Even before this recent series of 12 patches to 2.6.22-rc4, the aoe
        driver was reusing a small set of skbs that were allocated once and
        were only used for outbound AoE commands.
      
        The network layer cannot be allowed to put_page on the data that is
        still associated with a bio we haven't returned to the block layer,
        so the aoe driver (even before the patch under discussion) is still
        the owner of skbs that have been handed to the network layer for
        transmission.  We need to keep track of these skbs so that we can
        free them, but by tracking them, we can also easily re-use them.
      
        The new patch was a response to the behavior of certain network
        drivers.  We cannot reuse an skb that the network driver still has
        in its transmit ring.  Network drivers can defer transmit ring
        cleanup and then use the state in the skb to determine how many data
        segments to clean up in its transmit ring.  The tg3 driver is one
        driver that behaves in this way.
      
        When the network driver defers cleanup of its transmit ring, the aoe
        driver can find itself in a situation where it would like to send an
        AoE command, and the AoE target is ready for more work, but the
        network driver still has all of the pre-allocated skbs.  In that
        case, the new patch just calls alloc_skb, as you'd expect.
      
        We don't want to get carried away, though.  We try not to do
        excessive allocation in the write path, so we cap the number of skbs
        we dynamically allocate.
      
        Probably calling it a "dynamic pool" is misleading.  We were already
        trying to use a small fixed-size set of pre-allocated skbs before
        this patch, and this patch just provides a little headroom (with a
        ceiling, though) to accomodate network drivers that hang onto skbs,
        by allocating when needed.  The d->skbpool_hd list of allocated skbs
        is necessary so that we can free them later.
      
        We didn't notice the need for this headroom until AoE targets got
        fast enough.
      
      Alternatives
      
        If the network layer never did a put_page on the pages in the bio's
        we get from the block layer, then it would be possible for us to
        hand skbs to the network layer and forget about them, allowing the
        network layer to free skbs itself (and thereby calling our own
        skb->destructor callback function if we needed that).  In that case
        we could get rid of the pre-allocated skbs and also the
        d->skbpool_hd, instead just calling alloc_skb every time we wanted
        to transmit a packet.  The slab allocator would effectively maintain
        the list of skbs.
      
        Besides a loss of CPU cache locality, the main concern with that
        approach the danger that it would increase the likelihood of
        deadlock when VM is trying to free pages by writing dirty data from
        the page cache through the aoe driver out to persistent storage on
        an AoE device.  Right now we have a situation where we have
        pre-allocation that corresponds to how much we use, which seems
        ideal.
      
        Of course, there's still the separate issue of receiving the packets
        that tell us that a write has successfully completed on the AoE
        target.  When memory is low and VM is using AoE to flush dirty data
        to free up pages, it would be perfect if there were a way for us to
        register a fast callback that could recognize write command
        completion responses.  But I don't think the current problems with
        the receive side of the situation are a justification for
        exacerbating the problem on the transmit side.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9bb237b6
    • E
      aoe: user can ask driver to forget previously detected devices · 262bf541
      Ed L. Cashin 提交于
      When an AoE device is detected, the kernel is informed, and a new block device
      is created.  If the device is unused, the block device corresponding to remote
      device that is no longer available may be removed from the system by telling
      the aoe driver to "flush" its list of devices.
      
      Without this patch, software like GPFS and LVM may attempt to read from AoE
      devices that were discovered earlier but are no longer present, blocking until
      the I/O attempt times out.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      262bf541
    • E
      aoe: eliminate goto and improve readability · cf446f0d
      Ed L. Cashin 提交于
      Adam Richter suggested eliminating this goto.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cf446f0d
    • E
      aoe: mac_addr: avoid 64-bit arch compiler warnings · 1eb0da4c
      Ed L. Cashin 提交于
      By returning unsigned long long, mac_addr does not generate compiler warnings
      on 64-bit architectures.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1eb0da4c
    • E
      aoe: handle multiple network paths to AoE device · 68e0d42f
      Ed L. Cashin 提交于
      A remote AoE device is something can process ATA commands and is identified by
      an AoE shelf number and an AoE slot number.  Such a device might have more
      than one network interface, and it might be reachable by more than one local
      network interface.  This patch tracks the available network paths available to
      each AoE device, allowing them to be used more efficiently.
      
      Andrew Morton asked about the call to msleep_interruptible in the revalidate
      function.  Yes, if a signal is pending, then msleep_interruptible will not
      return 0.  That means we will not loop but will call aoenet_xmit with a NULL
      skb, which is a noop.  If the system is too low on memory or the aoe driver is
      too low on frames, then the user can hit control-C to interrupt the attempt to
      do a revalidate.  I have added a comment to the code summarizing that.
      
      Andrew Morton asked whether the allocation performed inside addtgt could use a
      more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
      lock has been locked with spin_lock_irqsave.  It would be nice to allocate the
      memory under fewer restrictions, but targets are only added when the device is
      being discovered, and if the target can't be added right now, we can try again
      in a minute when then next AoE config query broadcast goes out.
      
      Andrew Morton pointed out that the "too many targets" message could be printed
      for failing GFP_ATOMIC allocations.  The last patch in this series makes the
      messages more specific.
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      68e0d42f
    • E
      aoe: bring driver version number to 47 · 8911ef4d
      Ed L. Cashin 提交于
      Signed-off-by: NEd L. Cashin <ecashin@coraid.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8911ef4d
  21. 08 2月, 2008 1 次提交
  22. 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