1. 25 4月, 2008 5 次提交
  2. 23 4月, 2008 8 次提交
    • R
      [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo · 2d4d4864
      Ram Pai 提交于
      [mszeredi@suse.cz] rewrite and split big patch into managable chunks
      
      /proc/mounts in its current form lacks important information:
      
       - propagation state
       - root of mount for bind mounts
       - the st_dev value used within the filesystem
       - identifier for each mount and it's parent
      
      It also suffers from the following problems:
      
       - not easily extendable
       - ambiguity of mountpoints within a chrooted environment
       - doesn't distinguish between filesystem dependent and independent options
       - doesn't distinguish between per mount and per super block options
      
      This patch introduces /proc/<pid>/mountinfo which attempts to address
      all these deficiencies.
      
      Code shared between /proc/<pid>/mounts and /proc/<pid>/mountinfo is
      extracted into separate functions.
      
      Thanks to Al Viro for the help in getting the design right.
      Signed-off-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2d4d4864
    • M
      [patch 5/7] vfs: mountinfo: allow using process root · a1a2c409
      Miklos Szeredi 提交于
      Allow /proc/<pid>/mountinfo to use the root of <pid> to calculate
      mountpoints.
      
       - move definition of 'struct proc_mounts' to <linux/mnt_namespace.h>
       - add the process's namespace and root to this structure
       - pass a pointer to 'struct proc_mounts' into seq_operations
      
      In addition the following cleanups are made:
      
       - use a common open function for /proc/<pid>/{mounts,mountstat}
       - surround namespace.c part of these proc files with #ifdef CONFIG_PROC_FS
       - make the seq_operations structures const
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a1a2c409
    • M
      [patch 4/7] vfs: mountinfo: add mount peer group ID · 719f5d7f
      Miklos Szeredi 提交于
      Add a unique ID to each peer group using the IDR infrastructure.  The
      identifiers are reused after the peer group dissolves.
      
      The IDR structures are protected by holding namepspace_sem for write
      while allocating or deallocating IDs.
      
      IDs are allocated when a previously unshared vfsmount becomes the
      first member of a peer group.  When a new member is added to an
      existing group, the ID is copied from one of the old members.
      
      IDs are freed when the last member of a peer group is unshared.
      
      Setting the MNT_SHARED flag on members of a subtree is done as a
      separate step, after all the IDs have been allocated.  This way an
      allocation failure can be cleaned up easilty, without affecting the
      propagation state.
      
      Based on design sketch by Al Viro.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      719f5d7f
    • M
      [patch 3/7] vfs: mountinfo: add mount ID · 73cd49ec
      Miklos Szeredi 提交于
      Add a unique ID to each vfsmount using the IDR infrastructure.  The
      identifiers are reused after the vfsmount is freed.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      73cd49ec
    • M
      [patch 2/7] vfs: mountinfo: add seq_file_root() · 9d1bc601
      Miklos Szeredi 提交于
      Add a new function:
      
        seq_file_root()
      
      This is similar to seq_path(), but calculates the path relative to the
      given root, instead of current->fs->root.  If the path was unreachable
      from root, then modify the root parameter to reflect this.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9d1bc601
    • R
      [patch 1/7] vfs: mountinfo: add dentry_path() · 6092d048
      Ram Pai 提交于
      [mszeredi@suse.cz] split big patch into managable chunks
      
      Add the following functions:
      
        dentry_path()
        seq_dentry()
      
      These are similar to d_path() and seq_path().  But instead of
      calculating the path within a mount namespace, they calculate the path
      from the root of the filesystem to a given dentry, ignoring mounts
      completely.
      Signed-off-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6092d048
    • W
      i2c: Add platform driver on top of the new pca-algorithm · 244fbbb8
      Wolfram Sang 提交于
      Tested on a blackfin.
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      244fbbb8
    • W
      i2c-algo-pca: Extend for future drivers · c01b0831
      Wolfram Sang 提交于
      The separation between algorithm and adapter was unsharp at places. This was
      partly hidden by the fact, that the ISA-driver allowed just one instance and
      had all private data in static variables. This patch makes neccessary
      preparations to add a platform driver on top of the algorithm, while still
      supporting ISA. Note: Due to lack of hardware, the ISA-driver could not be
      tested except that it builds.
      
      Concerning the core struct i2c_algo_pca_data:
      
      - A private data field was added, all hardware dependant data may go here.
        Similar to other algorithms, now a pointer to this data is passed to the
        adapter's functions. In order to make as less changes as possible to the
        ISA-driver, it leaves the private data empty and still only uses its static
        variables.
      
      - A "reset_chip" function pointer was added; such a functionality must come
        from the adapter, not the algorithm.
      
      - use a variable "i2c_clock" instead of a function pointer "get_clock",
        allowing for write access to a default in case a wrong value was supplied.
      
      In the algorithm-file:
      
      - move "i2c-pca-algo.h" into "linux/i2c-algo-pca.h"
      - now using per_instance timeout values (i2c_adap->timeout)
      - error messages specify the device, not only the driver name
      - restructure initialization to easily support "i2c_add_numbered_adapter"
      - drop "retries" and "own" (i2c address) as they were unused
      
      (The state-machine for I2C-communication was not touched.)
      
      In the ISA-driver:
      
      - adapt to new algorithm
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      c01b0831
  3. 22 4月, 2008 19 次提交
  4. 21 4月, 2008 8 次提交
    • L
      Fix RCU list iterator use of 'rcu_dereference()' · cc216c5d
      Linus Torvalds 提交于
      The RCU iterators used 'rcu_dereference()' on an already-fetched RCU
      pointer value, which defeats the whole point of the exercise.
      
      When we dereference a pointer protected by RCU, we need to make sure
      that we only fetch the value _once_, because if the compiler ends up
      re-loading it due to register pressure, the newly reloaded value could
      be different from the previously fetched one, and you get inconsistent
      results.
      
      Cleaned-up, fixed, and the pointless list_for_each_safe_rcu #define
      deleted by Paul Kenney.
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cc216c5d
    • A
      block: fix memory hotplug and bouncing in block layer · 2472892a
      Andi Kleen 提交于
      Only noticed this while hacking something else, no test case.
      
      blk_max_low_pfn is initialized once at bootup by the block layer from
      max_low_pfn.  But max_low_pfn is not necessarily constant over the runtime of
      the system when you consider memory hotplug.  What could happen if that
      someone adds memory later the block layer wouldn't get updated and then start
      bouncing memory unnecessarily.
      
      Also on 64bit blk_max_low_pfn actually isn't needed because it just disables
      bouncing essentially and there is no highmem.  And nobody can pass pfns >
      max_low_pfn to the block layer, because those wouldn't have a struct page and
      I suspect block layer wouldn't be very happy without that.
      
      So set BLK_BOUNCE_HIGH to infinity (-1ULL) on 64bit.  That avoids the problem
      of having to update it on memory hotadd.
      
      On 32bit I kept the same behaviour because at least on i386
      memory hotadd only adds HIGHMEM, never lowmem.
      
      BLK_BOUNCE_ANY is always set to infinity on both 32 and 64bit.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Acked-by: NYasunori Goto <y-goto@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      2472892a
    • 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: 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
    • 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
    • D
      jiffies: add time_is_after_jiffies and others which compare with jiffies · 3f34d024
      Dave Young 提交于
      Most of time_after like macros usages just compare jiffies and another number,
      so here add some time_is_* macros for convenience.
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      3f34d024
    • I
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky 提交于
      Done per Linus' request and suggestions. Linus has explained that
      better than I'll be able to explain:
      
      On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
      > Actually, before we go any further, there might be a less intrusive
      > alternative: add just a couple of flags to the resource flags field (we
      > still have something like 8 unused bits on 32-bit), and use those to
      > implement a generic "resource_alignment()" routine.
      >
      > Two flags would do it:
      >
      >  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
      >    resources)
      >
      >  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
      >    during probing)
      >
      > and then the case of both flags zero (or both bits set) would actually be
      > "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
      > actually allocate the resource (so that we don't use the "start" field as
      > alignment incorrectly when it no longer indicates alignment).
      >
      > That wouldn't be totally generic, but it would have the nice property of
      > automatically at least add sanity checking for that whole "res->start has
      > the odd meaning of 'alignment' during probing" and remove the need for a
      > new field, and it would allow us to have a generic "resource_alignment()"
      > routine that just gets a resource pointer.
      
      Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.
      Signed-off-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88452565