• Jamie Lokier's avatar
    [PATCH] make NFS lockd port numbers assignable at run time · 3fd4a645
    Jamie Lokier authored
    When writing firewall rules, and you are serving NFS, it's really
    useful to know the port numbers of the various NFS services.  nfsd has
    a standard value; mountd and statd are userspace daemons, and those
    ports are settable on the command line.
    
    The fiddly one is lockd.  nlm_udpport and nlm_tcpport can be set on
    the kernel command line or at module load time, but after that it's a
    bit awkward (particularly as the lockd module can't be unloaded safely
    - "rmmod -f lockd" sometimes panics).
    
    This patch allows the port numbers and the other lockd parameters to
    be set through files in /proc/sys/fs/nfs/nlm_*.  The port numbers take
    effect when lockd is next started or restarted.
    
    In order to install the sysctl table even when compiled into the
    kernel, it was necessary to update the initialisation code to the
    current methods, using module_init() et al.  This patch does that and
    in so doing updates the module/kernel parameters to use the 2.6
    module_param() method, as well as making the numeric range changes
    consistent between the two.
    3fd4a645
lockd.h 6.33 KB