요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==================================
Administrative interfaces for nfsd
==================================
Note that normally these interfaces are used only by the utilities in
nfs-utils.
nfsd is controlled mainly by pseudofiles under the "nfsd" filesystem,
which is normally mounted at /proc/fs/nfsd/.
The server is always started by the first write of a nonzero value to
nfsd/threads.
Before doing that, NFSD can be told which sockets to listen on by
writing to nfsd/portlist; that write may be:
- an ascii-encoded file descriptor, which should refer to a
bound (and listening, for tcp) socket, or
- "transportname port", where transportname is currently either
"udp", "tcp", or "rdma".
If nfsd is started without doing any of these, then it will create one
udp and one tcp listener at port 2049 (see nfsd_init_socks).
On startup, nfsd and lockd grace periods start. nfsd is shut down by a write of
0 to nfsd/threads. All locks and state are thrown away at that point.
Between startup and shutdown, the number of threads may be adjusted up
or down by additional writes to nfsd/threads or by writes to
nfsd/pool_threads.
For more detail about files under nfsd/ and what they control, see
fs/nfsd/nfsctl.c; most of them have detailed comments.
Implementation notes
====================
Note that the rpc server requires the caller to serialize addition and
removal of listening sockets, and startup and shutdown of the server.
For nfsd this is done using nfsd_mutex.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
관리 interface 개요
1-9`Administrative interfaces for nfsd` 문서는 일반적으로 `nfs-utils`의 utility만 사용하는 NFSD 관리 interface를 설명합니다.
`nfsd`는 주로 `"nfsd" filesystem` 아래 pseudofile로 제어되며, 이 filesystem은 보통 `/proc/fs/nfsd/`에 mount됩니다.
Listener와 server 수명 주기
10-26Server는 `nfsd/threads`에 nonzero value를 처음 기록할 때 항상 시작됩니다. 그 전에 `nfsd/portlist`에 값을 기록해 listen할 socket을 지정할 수 있습니다.
기록 값은 bound socket을 가리키는 ASCII encoded file descriptor일 수 있습니다. TCP socket이라면 이미 listening 상태여야 합니다. 또는 `transportname port` 형식을 쓸 수 있으며 현재 transport name은 `udp`, `tcp`, `rdma`입니다.
이 설정 없이 nfsd를 시작하면 `nfsd_init_socks`가 port `2049`에 UDP listener 하나와 TCP listener 하나를 만듭니다.
Startup 시 nfsd와 lockd grace period가 시작됩니다. `nfsd/threads`에 `0`을 기록하면 nfsd가 종료되고, 그 시점에 모든 lock과 state가 폐기됩니다.
Thread 수와 세부 구현 위치
27-33Startup과 shutdown 사이에는 `nfsd/threads`에 추가로 값을 기록하거나 `nfsd/pool_threads`에 기록해 thread 수를 늘리거나 줄일 수 있습니다.
`nfsd/` 아래 각 file과 제어 대상의 자세한 설명은 `fs/nfsd/nfsctl.c`를 참고하십시오. 대부분 상세 comment를 포함합니다.
| 제어 지점 | 동작 |
|---|---|
| 기본 위치 | `"nfsd" filesystem`, 일반적으로 `/proc/fs/nfsd/`에 mount |
| 시작 | `nfsd/threads`에 첫 nonzero value 기록 |
| Listener 사전 설정 | `nfsd/portlist`에 ASCII file descriptor 또는 `transportname port` 기록 |
| 기본 listener | 별도 설정이 없으면 UDP와 TCP 각각 port `2049` |
| 종료 | `nfsd/threads`에 `0`을 기록하고 모든 lock과 state 폐기 |
| Thread 조정 | `nfsd/threads` 또는 `nfsd/pool_threads`에 추가 기록 |
구현 참고 사항
34-40`rpc server`는 호출자가 listening socket의 추가·제거와 server의 startup·shutdown을 직렬화해야 합니다. nfsd에서는 `nfsd_mutex`가 이 직렬화를 담당합니다.
운영 핵심
nfsd-admin-interfaces.rst:1-40`/proc/fs/nfsd/` 아래 interface로 transport listener와 NFSD thread를 구성하며, server 수명 주기 변경은 `nfsd_mutex`로 직렬화합니다.