X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fnfsd%2Fnfsd.c;h=2a3f5cca4ae736a41075b1ad0d1a597d3a823235;hp=650c59351722a7998d55116267ca17c830da0241;hb=5397edac120350bd5fd8284819c1a900cb41546c;hpb=542b5ba9e68a6bbabe9b29b5d29b5b793b3e8d4f diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index 650c593..2a3f5cc 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -27,6 +27,10 @@ #include "nfssvc.h" #include "xlog.h" +#ifndef NFSD_NPROC +#define NFSD_NPROC 8 +#endif + static void usage(const char *); static struct option longopts[] = @@ -90,11 +94,11 @@ nfsd_enable_protos(unsigned int *proto4, unsigned int *proto6) int main(int argc, char **argv) { - int count = 1, c, error = 0, portnum = 0, fd, found_one; + int count = NFSD_NPROC, c, error = 0, portnum = 0, fd, found_one; char *p, *progname, *port; char *haddr = NULL; int socket_up = 0; - int minorvers4 = NFSD_MAXMINORVERS4; /* nfsv4 minor version */ + int minorvers41 = 0; /* nfsv4 minor version */ unsigned int versbits = NFSCTL_ALLBITS; unsigned int protobits = NFSCTL_ALLBITS; unsigned int proto4 = 0; @@ -154,7 +158,12 @@ main(int argc, char **argv) switch((c = strtol(optarg, &p, 0))) { case 4: if (*p == '.') { - minorvers4 = -atoi(p + 1); + int i = atoi(p+1); + if (i != 1) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } + minorvers41 = -1; break; } case 3: @@ -237,6 +246,9 @@ main(int argc, char **argv) exit(1); } + /* make sure nfsdfs is mounted if it's available */ + nfssvc_mount_nfsdfs(progname); + /* can only change number of threads if nfsd is already up */ if (nfssvc_inuse()) { socket_up = 1; @@ -248,7 +260,7 @@ main(int argc, char **argv) * registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ - nfssvc_setvers(versbits, minorvers4); + nfssvc_setvers(versbits, minorvers41); error = nfssvc_set_sockets(AF_INET, proto4, haddr, port); if (!error)