1. 01 Jul, 2006 8 commits
  2. 30 Jun, 2006 5 commits
  3. 27 Jun, 2006 1 commit
  4. 26 Jun, 2006 2 commits
  5. 23 Jun, 2006 1 commit
    • David Howells's avatar
      [PATCH] VFS: Permit filesystem to override root dentry on mount · 454e2398
      David Howells authored
      Extend the get_sb() filesystem operation to take an extra argument that
      permits the VFS to pass in the target vfsmount that defines the mountpoint.
      The filesystem is then required to manually set the superblock and root dentry
      pointers.  For most filesystems, this should be done with simple_set_mnt()
      which will set the superblock pointer and then set the root dentry to the
      superblock's s_root (as per the old default behaviour).
      The get_sb() op now returns an integer as there's now no need to return the
      superblock pointer.
      This patch permits a superblock to be implicitly shared amongst several mount
      points, such as can be done with NFS to avoid potential inode aliasing.  In
      such a case, simple_set_mnt() would not be called, and instead the mnt_root
      and mnt_sb would be set directly.
      The patch also makes the following changes:
       (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
           pointer argument and return an integer, so most filesystems have to change
           very little.
       (*) If one of the convenience function is not used, then get_sb() should
           normally call simple_set_mnt() to instantiate the vfsmount. This will
           always return 0, and so can be tail-called from get_sb().
       (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
           dcache upon superblock destruction rather than shrink_dcache_anon().
           This is required because the superblock may now have multiple trees that
           aren't actually bound to s_root, but that still need to be cleaned up. The
           currently called functions assume that the whole tree is rooted at s_root,
           and that anonymous dentries are not the roots of trees which results in
           dentries being left unculled.
           However, with the way NFS superblock sharing are currently set to be
           implemented, these assumptions are violated: the root of the filesystem is
           simply a dummy dentry and inode (the real inode for '/' may well be
           inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
           with child trees.
           [*] Anonymous until discovered from another tree.
       (*) The documentation has been adjusted, including the additional bit of
           changing ext2_* into foo_* in the documentation.
      [akpm@osdl.org: convert ipath_fs, do other stuff]
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Nathan Scott <nathans@sgi.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  6. 22 Jun, 2006 8 commits
  7. 18 Jun, 2006 15 commits
    • Herbert Xu's avatar
      [NET]: Add netif_tx_lock · 932ff279
      Herbert Xu authored
      Various drivers use xmit_lock internally to synchronise with their
      transmission routines.  They do so without setting xmit_lock_owner.
      This is fine as long as netpoll is not in use.
      With netpoll it is possible for deadlocks to occur if xmit_lock_owner
      isn't set.  This is because if a printk occurs while xmit_lock is held
      and xmit_lock_owner is not set can cause netpoll to attempt to take
      xmit_lock recursively.
      While it is possible to resolve this by getting netpoll to use
      trylock, it is suboptimal because netpoll's sole objective is to
      maximise the chance of getting the printk out on the wire.  So
      delaying or dropping the message is to be avoided as much as possible.
      So the only alternative is to always set xmit_lock_owner.  The
      following patch does this by introducing the netif_tx_lock family of
      functions that take care of setting/unsetting xmit_lock_owner.
      I renamed xmit_lock to _xmit_lock to indicate that it should not be
      used directly.  I didn't provide irq versions of the netif_tx_lock
      functions since xmit_lock is meant to be a BH-disabling lock.
      This is pretty much a straight text substitution except for a small
      bug fix in winbond.  It currently uses
      netif_stop_queue/spin_unlock_wait to stop transmission.  This is
      unsafe as an IRQ can potentially wake up the queue.  So it is safer to
      use netif_tx_disable.
      The hamradio bits used spin_lock_irq but it is unnecessary as
      xmit_lock must never be taken in an IRQ handler.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Roland Dreier's avatar
      IB/uverbs: Don't serialize with ib_uverbs_idr_mutex · 9ead190b
      Roland Dreier authored
      Currently, all userspace verbs operations that call into the kernel
      are serialized by ib_uverbs_idr_mutex.  This can be a scalability
      issue for some workloads, especially for devices driven by the ipath
      driver, which needs to call into the kernel even for datapath
      Fix this by adding reference counts to the userspace objects, and then
      converting ib_uverbs_idr_mutex into a spinlock that only protects the
      idrs long enough to take a reference on the object being looked up.
      Because remove operations may fail, we have to do a slightly funky
      two-step deletion, which is described in the comments at the top of
      This also still leaves ib_uverbs_idr_lock as a single lock that is
      possibly subject to contention.  However, the lock hold time will only
      be a single idr operation, so multiple threads should still be able to
      make progress, even if ib_uverbs_idr_lock is being ping-ponged.
      Surprisingly, these changes even shrink the object code:
      add/remove: 23/5 grow/shrink: 4/21 up/down: 633/-693 (-60)
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Roland Dreier's avatar
      IB/mthca: Make all device methods truly reentrant · c93b6fba
      Roland Dreier authored
      Documentation/infiniband/core_locking.txt says:
        All of the methods in struct ib_device exported by a low-level
        driver must be fully reentrant.  The low-level driver is required to
        perform all synchronization necessary to maintain consistency, even
        if multiple function calls using the same object are run
      However, mthca's modify_qp, modify_srq and resize_cq methods are
      currently not reentrant.  Add a mutex to the QP, SRQ and CQ structures
      so that these calls can be properly serialized.
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Roland Dreier's avatar
      IB/mthca: Fix memory leak on modify_qp error paths · c9c5d9fe
      Roland Dreier authored
      Some error paths after the mthca_alloc_mailbox() call in mthca_modify_qp()
      just do a "return -EINVAL" without freeing the mailbox.  Convert these
      returns to "goto out" to avoid leaking the mailbox storage.
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Roland Dreier's avatar
      IB/uverbs: Factor out common idr code · 3463175d
      Roland Dreier authored
      Factor out common code for adding a userspace object to an idr into a
      function idr_add_uobj().  This shrinks both the source and object code:
      add/remove: 1/0 grow/shrink: 0/6 up/down: 57/-220 (-163)
      function                                     old     new   delta
      idr_add_uobj                                   -      57     +57
      ib_uverbs_create_ah                          543     512     -31
      ib_uverbs_create_srq                         662     630     -32
      ib_uverbs_reg_mr                             737     699     -38
      ib_uverbs_create_cq                          639     600     -39
      ib_uverbs_alloc_pd                           485     446     -39
      ib_uverbs_create_qp                         1020     979     -41
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Roland Dreier's avatar
      IB/uverbs: Don't decrement usecnt on error paths · 92b15822
      Roland Dreier authored
      In error paths when destroying an object, uverbs should not decrement
      associated objects' usecnt, since ib_dereg_mr(), ib_destroy_qp(),
      etc. already do that.
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Ganapathi CH's avatar
      IB/uverbs: Release lock on error path · 77f76013
      Ganapathi CH authored
      If ibdev->alloc_ucontext() fails then ib_uverbs_get_context() does not
      unlock file->mutex before returning error.
      Signed-off by: Ganapathi CH <cganapathi@novell.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Sean Hefty's avatar
      IB/cm: Use address handle helpers · ca222c6b
      Sean Hefty authored
      Use new ib_init_ah_from_wc() and ib_init_ah_from_path() helper
      functions to clean up the IB CM.
      Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Sean Hefty's avatar
      IB/sa: Add ib_init_ah_from_path() · 6d969a47
      Sean Hefty authored
      Add a call to initialize address handle attributes given a path record.
      This is used by the CM, and would be useful for users of UD QPs.
      Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Sean Hefty's avatar
      IB: Add ib_init_ah_from_wc() · 4e00d694
      Sean Hefty authored
      Add a function to initialize address handle attributes from a work
      completion.  This functionality is duplicated by both verbs and the CM.
      Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Sean Hefty's avatar
      IB/ucm: Get rid of duplicate P_Key parameter · 75af9088
      Sean Hefty authored
      The P_Key is provided into a SIDR REQ in two places, once as a
      parameter, and again in the path record.  Remove the P_Key as a
      parameter and always use the one given in the path record.
      This change has no practical effect on ABI functionality.
      Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Ishai Rabinovitz's avatar
      IB/srp: Factor out common request reset code · 526b4caa
      Ishai Rabinovitz authored
      Misc cleanups in ib_srp:
      1) I think that it is more efficient to move the req entries from req_list
         to free_list in srp_reconnect_target (rather than rebuild the free_list).
         (In any case this code is shorter).
      2) This allows us to reuse code in srp_reset_device and srp_reconnect_target
         and call a new function srp_reset_req.
      Signed-off-by: default avatarIshai Rabinovitz <ishai@mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Ramachandra K's avatar
      IB/srp: Support SRP rev. 10 targets · 0c0450db
      Ramachandra K authored
      There has been a change in the format of port identifiers between
      revision 10 of the SRP specification and the current revision 16A.
      Revision 10 specifies port identifier format as
        lower 8 bytes :  GUID   upper 8 bytes :  Extension
      Whereas revision 16A specifies it as 
       lower 8 bytes :  Extension  upper 8 bytes :  GUID
      There are older targets (e.g. SilverStorm Virtual Fibre Channel
      Bridge) which conform to revision 10 of the SRP specification.
      The I/O class of revision 10 is 0xFF00 and the I/O class of revision
      16A is 0x0100.
      For supporting older targets, this patch:
      1) Adds a new optional target creation parameter "io_class". Default
         value of io_class is 0x0100 (i.e. revision 16A)
      2) Uses the correct port identifier format for targets with IO class
         of 0xFF00 (i.e. conforming to revision 10)
      Signed-off-by: default avatarRamachandra K <rkuchimanchi@silverstorm.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Or Gerlitz's avatar
      IB/fmr: Use device's max_map_map_per_fmr attribute in FMR pool. · 6c8c1aa2
      Or Gerlitz authored
      When creating a FMR pool, query the IB device and use the returned
      max_map_map_per_fmr attribute as for the max number of FMR remaps. If
      the device does not suport querying this attribute, use the original
      IB_FMR_MAX_REMAPS (32) default.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    • Or Gerlitz's avatar
      IB/mthca: Fill in max_map_per_fmr device attribute · d4cb0784
      Or Gerlitz authored
      Report the true max_map_per_fmr value from mthca_query_device(),
      taking into account the change in FMR remapping introduced by the
      Sinai performance optimization.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>