1*0f3456baSDaniel W. S. Almeida================================== 2*0f3456baSDaniel W. S. AlmeidaAdministrative interfaces for nfsd 3*0f3456baSDaniel W. S. Almeida================================== 4*0f3456baSDaniel W. S. Almeida 5*0f3456baSDaniel W. S. AlmeidaNote that normally these interfaces are used only by the utilities in 6*0f3456baSDaniel W. S. Almeidanfs-utils. 7*0f3456baSDaniel W. S. Almeida 8*0f3456baSDaniel W. S. Almeidanfsd is controlled mainly by pseudofiles under the "nfsd" filesystem, 9*0f3456baSDaniel W. S. Almeidawhich is normally mounted at /proc/fs/nfsd/. 10*0f3456baSDaniel W. S. Almeida 11*0f3456baSDaniel W. S. AlmeidaThe server is always started by the first write of a nonzero value to 12*0f3456baSDaniel W. S. Almeidanfsd/threads. 13*0f3456baSDaniel W. S. Almeida 14*0f3456baSDaniel W. S. AlmeidaBefore doing that, NFSD can be told which sockets to listen on by 15*0f3456baSDaniel W. S. Almeidawriting to nfsd/portlist; that write may be: 16*0f3456baSDaniel W. S. Almeida 17*0f3456baSDaniel W. S. Almeida - an ascii-encoded file descriptor, which should refer to a 18*0f3456baSDaniel W. S. Almeida bound (and listening, for tcp) socket, or 19*0f3456baSDaniel W. S. Almeida - "transportname port", where transportname is currently either 20*0f3456baSDaniel W. S. Almeida "udp", "tcp", or "rdma". 21*0f3456baSDaniel W. S. Almeida 22*0f3456baSDaniel W. S. AlmeidaIf nfsd is started without doing any of these, then it will create one 23*0f3456baSDaniel W. S. Almeidaudp and one tcp listener at port 2049 (see nfsd_init_socks). 24*0f3456baSDaniel W. S. Almeida 25*0f3456baSDaniel W. S. AlmeidaOn startup, nfsd and lockd grace periods start. nfsd is shut down by a write of 26*0f3456baSDaniel W. S. Almeida0 to nfsd/threads. All locks and state are thrown away at that point. 27*0f3456baSDaniel W. S. Almeida 28*0f3456baSDaniel W. S. AlmeidaBetween startup and shutdown, the number of threads may be adjusted up 29*0f3456baSDaniel W. S. Almeidaor down by additional writes to nfsd/threads or by writes to 30*0f3456baSDaniel W. S. Almeidanfsd/pool_threads. 31*0f3456baSDaniel W. S. Almeida 32*0f3456baSDaniel W. S. AlmeidaFor more detail about files under nfsd/ and what they control, see 33*0f3456baSDaniel W. S. Almeidafs/nfsd/nfsctl.c; most of them have detailed comments. 34*0f3456baSDaniel W. S. Almeida 35*0f3456baSDaniel W. S. AlmeidaImplementation notes 36*0f3456baSDaniel W. S. Almeida==================== 37*0f3456baSDaniel W. S. Almeida 38*0f3456baSDaniel W. S. AlmeidaNote that the rpc server requires the caller to serialize addition and 39*0f3456baSDaniel W. S. Almeidaremoval of listening sockets, and startup and shutdown of the server. 40*0f3456baSDaniel W. S. AlmeidaFor nfsd this is done using nfsd_mutex. 41