IF Commons GitHub

governance/nfs

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0006-anyfs-serve-nfs FR-003, 0006-anyfs-serve-nfs FR-004, 0006-anyfs-serve-nfs FR-009

The facts of NFS version 3 (RFC 1813) and its mount protocol, as closed lists and one total table: the programs and procedures the server answers, the statuses it gives, the types of an object, and the table from a code of the POSIX view to a status. A failure is said as a local file system would say it: ENOENT is NFS3ERR_NOENT, and the few codes whose number NFS does not take from Linux (ENAMETOOLONG, ENOTEMPTY, ESTALE, ENOTSUP, EBADF) have the number RFC 1813 gives them.

import { nfsStatusOfErrno } from "./nfs.ts";
nfsStatusOfErrno("ENOENT"); // 2
nfsStatusOfErrno("ESTALE"); // 70

Source: commons/anyfs-serve/src/governance/nfs.ts

6 of 19 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

NFS_PROGRAMconst
const NFS_PROGRAM: 100003

The programs of ONC RPC the server answers: NFS and its mount protocol.

Imported by 15 tests of the run (15 passed, 0 failed): the library's results

MOUNT_PROGRAMconst
const MOUNT_PROGRAM: 100005

The program number of the mount protocol of ONC RPC.

Imported by 15 tests of the run (15 passed, 0 failed): the library's results

NFS_VERSIONconstno test imports it
const NFS_VERSION: 3

The only versions: NFS 3 and MOUNT 3.

MOUNT_VERSIONconstno test imports it
const MOUNT_VERSION: 3

The one version of the mount protocol answered: 3.

NFS_PROCEDURESconstno test imports it
const NFS_PROCEDURES: readonly ["NULL", "GETATTR", "SETATTR", "LOOKUP", "ACCESS", "READLINK", "READ", "WRITE", "CREATE", "MKDIR", "SYMLINK", "MKNOD", "REMOVE", "RMDIR", "RENAME", "LINK", "READDIR", "READDIRPLUS", "FSSTAT", "FSINFO", "PATHCONF", "COMMIT"]

The procedures of NFS version 3, by number.

NfsProceduretypeno test imports it
type NfsProcedure = (typeof NFS_PROCEDURES)[number];

One procedure of NFS.

MOUNT_PROCEDURESconstno test imports it
const MOUNT_PROCEDURES: readonly ["NULL", "MNT", "DUMP", "UMNT", "UMNTALL", "EXPORT"]

The procedures of the mount protocol, by number.

MountProceduretypeno test imports it
type MountProcedure = (typeof MOUNT_PROCEDURES)[number];

One procedure of the mount protocol.

NFS_STATUSconst
const NFS_STATUS: { readonly OK: 0; readonly PERM: 1; readonly NOENT: 2; readonly IO: 5; readonly ACCES: 13; readonly EX… (477 characters)
const NFS_STATUS: { readonly OK: 0; readonly PERM: 1; readonly NOENT: 2; readonly IO: 5; readonly ACCES: 13; readonly EXIST: 17; readonly XDEV: 18; readonly NOTDIR: 20; readonly ISDIR: 21; readonly INVAL: 22; readonly FBIG: 27; readonly ROFS: 30; readonly NAMETOOLONG: 63; readonly NOTEMPTY: 66; readonly STALE: 70; readonly BADHANDLE: 10001; readonly BAD_COOKIE: 10003; readonly NOTSUPP: 10004; readonly TOOSMALL: 10005; readonly SERVERFAULT: 10006; readonly BADTYPE: 10007; }

The statuses of RFC 1813 the server gives.

Imported by 21 tests of the run (21 passed, 0 failed): the library's results

NfsStatusNametypeno test imports it
type NfsStatusName = keyof typeof NFS_STATUS;

The name of a status.

NfsStatustypeno test imports it
type NfsStatus = (typeof NFS_STATUS)[NfsStatusName];

The number of a status.

MOUNT_STATUSconstno test imports it
const MOUNT_STATUS: { readonly OK: 0; readonly NOENT: 2; readonly ACCES: 13; readonly INVAL: 22; }

The statuses of the mount protocol the server gives.

FTYPEconstno test imports it
const FTYPE: { readonly file: 1; readonly dir: 2; }

The types of an object in NFS (ftype3): the store has files and directories only.

ERRNOS_DIFFERconst
const ERRNOS_DIFFER: readonly ("EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV")[]

The codes whose status is not the number of Linux.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

nfsStatusOfErrnofunction
function nfsStatusOfErrno(errno: "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"): NfsStatus

The status of a code of the POSIX view: the number of Linux where NFS takes it, else the number of RFC 1813. Total: a registry the compiler holds with one entry for each code.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

isNfsStatusfunction
function isNfsStatus(n: number): n is NfsStatus

Whether a number is a status of RFC 1813 the server gives.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

TRANSFERconstno test imports it
const TRANSFER: { readonly rtmax: 1048576; readonly rtpref: 262144; readonly rtmult: 4096; readonly wtmax: 1048576; readonly wtpref: 262144; readonly wtmult: 4096; readonly dtpref: 32768; }

What the server tells a client it can do (FSINFO): the sizes of a transfer.

ACCESSconstno test imports it
const ACCESS: { readonly READ: 1; readonly LOOKUP: 2; readonly MODIFY: 4; readonly EXTEND: 8; readonly DELETE: 16; readonly EXECUTE: 32; }

The bits of ACCESS.

STABLEconstno test imports it
const STABLE: { readonly UNSTABLE: 0; readonly DATA_SYNC: 1; readonly FILE_SYNC: 2; }

How stable a write is asked to be (stable_how).

Titles, headings, exports, tables, columns and requirements. Esc closes.