1. 22 9月, 2010 1 次提交
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 07 3月, 2010 1 次提交
  4. 10 2月, 2010 1 次提交
  5. 30 11月, 2009 1 次提交
  6. 18 6月, 2009 4 次提交
  7. 17 6月, 2009 1 次提交
  8. 04 4月, 2009 1 次提交
  9. 30 3月, 2009 1 次提交
  10. 29 3月, 2009 6 次提交
    • C
      SUNRPC: rpcb_register() should handle errors silently · 363f724c
      Chuck Lever 提交于
      Move error reporting for RPC registration to rpcb_register's caller.
      
      This way the caller can choose to recover silently from certain
      errors, but report errors it does not recognize.  Error reporting
      for kernel RPC service registration is now handled in one place.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      363f724c
    • C
      SUNRPC: Simplify kernel RPC service registration · cadc0fa5
      Chuck Lever 提交于
      The kernel registers RPC services with the local portmapper with an
      rpcbind SET upcall to the local portmapper.  Traditionally, this used
      rpcbind v2 (PMAP), but registering RPC services that support IPv6
      requires rpcbind v3 or v4.
      
      Since we now want separate PF_INET and PF_INET6 listeners for each
      kernel RPC service, svc_register() will do only one of those
      registrations at a time.
      
      For PF_INET, it tries an rpcb v4 SET upcall first; if that fails, it
      does a legacy portmap SET.  This makes it entirely backwards
      compatible with legacy user space, but allows a proper v4 SET to be
      used if rpcbind is available.
      
      For PF_INET6, it does an rpcb v4 SET upcall.  If that fails, it fails
      the registration, and thus the transport creation.  This let's the
      kernel detect if user space is able to support IPv6 RPC services, and
      thus whether it should maintain a PF_INET6 listener for each service
      at all.
      
      This provides complete backwards compatibilty with legacy user space
      that only supports rpcbind v2.  The only down-side is that registering
      a new kernel RPC service may take an extra exchange with the local
      portmapper on legacy systems, but this is an infrequent operation and
      is done over UDP (no lingering sockets in TIMEWAIT), so it shouldn't
      be consequential.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      cadc0fa5
    • C
      SUNRPC: Simplify svc_unregister() · d5a8620f
      Chuck Lever 提交于
      Our initial implementation of svc_unregister() assumed that PMAP_UNSET
      cleared all rpcbind registrations for a [program, version] tuple.
      However, we now have evidence that PMAP_UNSET clears only "inet"
      entries, and not "inet6" entries, in the rpcbind database.
      
      For backwards compatibility with the legacy portmapper, the
      svc_unregister() function also must work if user space doesn't support
      rpcbind version 4 at all.
      
      Thus we'll send an rpcbind v4 UNSET, and if that fails, we'll send a
      PMAP_UNSET.
      
      This simplifies the code in svc_unregister() and provides better
      backwards compatibility with legacy user space that does not support
      rpcbind version 4.  We can get rid of the conditional compilation in
      here as well.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d5a8620f
    • C
      SUNRPC: Don't return EPROTONOSUPPORT in svc_register()'s helpers · ba5c35e0
      Chuck Lever 提交于
      The RPC client returns -EPROTONOSUPPORT if there is a protocol version
      mismatch (ie the remote RPC server doesn't support the RPC protocol
      version sent by the client).
      
      Helpers for the svc_register() function return -EPROTONOSUPPORT if they
      don't recognize the passed-in IPPROTO_ value.
      
      These are two entirely different failure modes.
      
      Have the helpers return -ENOPROTOOPT instead of -EPROTONOSUPPORT.  This
      will allow callers to determine more precisely what the underlying
      problem is, and decide to report or recover appropriately.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ba5c35e0
    • C
      SUNRPC: Remove @family argument from svc_create() and svc_create_pooled() · 49a9072f
      Chuck Lever 提交于
      Since an RPC service listener's protocol family is specified now via
      svc_create_xprt(), it no longer needs to be passed to svc_create() or
      svc_create_pooled().  Remove that argument from the synopsis of those
      functions, and remove the sv_family field from the svc_serv struct.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      49a9072f
    • C
      SUNRPC: Pass a family argument to svc_register() · 4b62e58c
      Chuck Lever 提交于
      The sv_family field is going away.  Instead of using sv_family, have
      the svc_register() function take a protocol family argument.
      
      Since this argument represents a protocol family, and not an address
      family, this argument takes an int, as this is what is passed to
      sock_create_kern().  Also make sure svc_register's helpers are
      checking for PF_FOO instead of AF_FOO.  The value of [AP]F_FOO are
      equivalent; this is simply a symbolic change to reflect the semantics
      of the value stored in that variable.
      
      sock_create_kern() should return EPFNOSUPPORT if the passed-in
      protocol family isn't supported, but it uses EAFNOSUPPORT for this
      case.  We will stick with that tradition here, as svc_register()
      is called by the RPC server in the same path as sock_create_kern().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4b62e58c
  11. 28 3月, 2009 1 次提交
  12. 13 3月, 2009 1 次提交
  13. 08 1月, 2009 1 次提交
  14. 30 9月, 2008 6 次提交
    • C
      SUNRPC: Fix up svc_unregister() · f6fb3f6f
      Chuck Lever 提交于
      With the new rpcbind code, a PMAP_UNSET will not have any effect on
      services registered via rpcbind v3 or v4.
      
      Implement a version of svc_unregister() that uses an RPCB_UNSET with
      an empty netid string to make sure we have cleared *all* entries for
      a kernel RPC service when shutting down, or before starting a fresh
      instance of the service.
      
      Use the new version only when CONFIG_SUNRPC_REGISTER_V4 is enabled;
      otherwise, the legacy PMAP version is used to ensure complete
      backwards-compatibility with the Linux portmapper daemon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      f6fb3f6f
    • C
      SUNRPC: Register both netids for AF_INET6 servers · 2c7eb0b2
      Chuck Lever 提交于
      TI-RPC is a user-space library of RPC functions that replaces ONC RPC
      and allows RPC to operate in the new world of IPv6.
      
      TI-RPC combines the concept of a transport protocol (UDP and TCP)
      and a protocol family (PF_INET and PF_INET6) into a single identifier
      called a "netid."  For example, "udp" means UDP over IPv4, and "udp6"
      means UDP over IPv6.
      
      For rpcbind, then, the RPC service tuple that is registered and
      advertised is:
      
        [RPC program, RPC version, service address and port, netid]
      
      instead of
      
        [RPC program, RPC version, port, protocol]
      
      Service address is typically ANYADDR, but can be a specific address
      of one of the interfaces on a multi-homed host.  The third item in
      the new tuple is expressed as a universal address.
      
      The current Linux rpcbind implementation registers a netid for both
      protocol families when RPCB_SET is done for just the PF_INET6 version
      of the netid (ie udp6 or tcp6).  So registering "udp6" causes a
      registration for "udp" to appear automatically as well.
      
      We've recently determined that this is incorrect behavior.  In the
      TI-RPC world, "udp6" is not meant to imply that the registered RPC
      service handles requests from AF_INET as well, even if the listener
      socket does address mapping.  "udp" and "udp6" are entirely separate
      capabilities, and must be registered separately.
      
      The Linux kernel, unlike TI-RPC, leverages address mapping to allow a
      single listener socket to handle requests for both AF_INET and AF_INET6.
      This is still OK, but the kernel currently assumes registering "udp6"
      will cover "udp" as well.  It registers only "udp6" for it's AF_INET6
      services, even though they handle both AF_INET and AF_INET6 on the same
      port.
      
      So svc_register() actually needs to register both "udp" and "udp6"
      explicitly (and likewise for TCP).  Until rpcbind is fixed, the
      kernel can ignore the return code for the second RPCB_SET call.
      
      Please merge this with commit 15231312:
      
          SUNRPC: Support IPv6 when registering kernel RPC services
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: Olaf Kirch <okir@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2c7eb0b2
    • C
      SUNRPC: Support IPv6 when registering kernel RPC services · a26cfad6
      Chuck Lever 提交于
      In order to advertise NFS-related services on IPv6 interfaces via
      rpcbind, the kernel RPC server implementation must use
      rpcb_v4_register() instead of rpcb_register().
      
      A new kernel build option allows distributions to use the legacy
      v2 call until they integrate an appropriate user-space rpcbind
      daemon that can support IPv6 RPC services.
      
      I tried adding some automatic logic to fall back if registering
      with a v4 protocol request failed, but there are too many corner
      cases.  So I just made it a compile-time switch that distributions
      can throw when they've replaced portmapper with rpcbind.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a26cfad6
    • C
      SUNRPC: Split portmap unregister API into separate function · 7252d575
      Chuck Lever 提交于
      Create a separate server-level interface for unregistering RPC services.
      
      The mechanics of, and the API for, registering and unregistering RPC
      services will diverge further as support for IPv6 is added.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7252d575
    • C
      SUNRPC: Simplify rpcb_register() API · 14aeb211
      Chuck Lever 提交于
      Bruce suggested there's no need to expose the difference between an error
      sending the PMAP_SET request and an error reply from the portmapper to
      rpcb_register's callers.  The user space equivalent of rpcb_register() is
      pmap_set(3), which returns a bool_t : either the PMAP set worked, or it
      didn't.  Simple.
      
      So let's remove the "*okay" argument from rpcb_register() and
      rpcb_v4_register(), and simply return an error if any part of the call
      didn't work.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      14aeb211
    • C
      SUNRPC: Add address family field to svc_serv data structure · e851db5b
      Chuck Lever 提交于
      Introduce and initialize an address family field in the svc_serv structure.
      
      This field will determine what family to use for the service's listener
      sockets and what families are advertised via the local rpcbind daemon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      e851db5b
  15. 26 7月, 2008 1 次提交
  16. 19 7月, 2008 1 次提交
    • M
      cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr · 65c01184
      Mike Travis 提交于
        * This patch replaces the dangerous lvalue version of cpumask_of_cpu
          with new cpumask_of_cpu_ptr macros.  These are patterned after the
          node_to_cpumask_ptr macros.
      
          In general terms, if there is a cpumask_of_cpu_map[] then a pointer to
          the cpumask_of_cpu_map[cpu] entry is used.  The cpumask_of_cpu_map
          is provided when there is a large NR_CPUS count, reducing
          greatly the amount of code generated and stack space used for
          cpumask_of_cpu().  The pointer to the cpumask_t value is needed for
          calling set_cpus_allowed_ptr() to reduce the amount of stack space
          needed to pass the cpumask_t value.
      
          If there isn't a cpumask_of_cpu_map[], then a temporary variable is
          declared and filled in with value from cpumask_of_cpu(cpu) as well as
          a pointer variable pointing to this temporary variable.  Afterwards,
          the pointer is used to reference the cpumask value.  The compiler
          will optimize out the extra dereference through the pointer as well
          as the stack space used for the pointer, resulting in identical code.
      
          A good example of the orthogonal usages is in net/sunrpc/svc.c:
      
      	case SVC_POOL_PERCPU:
      	{
      		unsigned int cpu = m->pool_to[pidx];
      		cpumask_of_cpu_ptr(cpumask, cpu);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, cpumask);
      		return 1;
      	}
      	case SVC_POOL_PERNODE:
      	{
      		unsigned int node = m->pool_to[pidx];
      		node_to_cpumask_ptr(nodecpumask, node);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, nodecpumask);
      		return 1;
      	}
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      65c01184
  17. 24 6月, 2008 3 次提交
  18. 24 5月, 2008 1 次提交
  19. 09 5月, 2008 1 次提交
  20. 24 4月, 2008 5 次提交
  21. 20 4月, 2008 1 次提交
    • M
      nodemask: use new node_to_cpumask_ptr function · c5f59f08
      Mike Travis 提交于
        * Use new node_to_cpumask_ptr.  This creates a pointer to the
          cpumask for a given node.  This definition is in mm patch:
      
      	asm-generic-add-node_to_cpumask_ptr-macro.patch
      
        * Use new set_cpus_allowed_ptr function.
      
      Depends on:
      	[mm-patch]: asm-generic-add-node_to_cpumask_ptr-macro.patch
      	[sched-devel]: sched: add new set_cpus_allowed_ptr function
      	[x86/latest]: x86: add cpus_scnprintf function
      
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Greg Banks <gnb@melbourne.sgi.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c5f59f08