Commit 2f123b9a authored by Daniel W. S. Almeida's avatar Daniel W. S. Almeida Committed by Jonathan Corbet

Documentation: convert nfs.txt to ReST

This patch converts nfs.txt to RST. It also moves it to admin-guide.
The reason for moving it is because this document contains information
useful for system administrators, as noted on the following paragraph:

'The purpose of this document is to provide information on some of the
special features of the NFS client that can be configured by system
administrators'.
Signed-off-by: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
Link: https://lore.kernel.org/r/cb9f2da2f2f6dd432b4cf9e05f79f74f4d54b6ab.1578697871.git.dwlsalmeida@gmail.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent a1986433
...@@ -76,6 +76,7 @@ configure specific aspects of kernel behavior to your liking. ...@@ -76,6 +76,7 @@ configure specific aspects of kernel behavior to your liking.
device-mapper/index device-mapper/index
efi-stub efi-stub
ext4 ext4
nfs/index
gpio/index gpio/index
highuid highuid
hw_random hw_random
......
=============
NFS
=============
.. toctree::
:maxdepth: 1
nfs-client
==========
NFS Client
==========
The NFS client The NFS client
============== ==============
...@@ -59,10 +62,11 @@ The DNS resolver ...@@ -59,10 +62,11 @@ The DNS resolver
NFSv4 allows for one server to refer the NFS client to data that has been NFSv4 allows for one server to refer the NFS client to data that has been
migrated onto another server by means of the special "fs_locations" migrated onto another server by means of the special "fs_locations"
attribute. See attribute. See `RFC3530 Section 6: Filesystem Migration and Replication`_ and
http://tools.ietf.org/html/rfc3530#section-6 `Implementation Guide for Referrals in NFSv4`_.
and
http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00 .. _RFC3530 Section 6\: Filesystem Migration and Replication: http://tools.ietf.org/html/rfc3530#section-6
.. _Implementation Guide for Referrals in NFSv4: http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00
The fs_locations information can take the form of either an ip address and The fs_locations information can take the form of either an ip address and
a path, or a DNS hostname and a path. The latter requires the NFS client to a path, or a DNS hostname and a path. The latter requires the NFS client to
...@@ -94,7 +98,8 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual ...@@ -94,7 +98,8 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
script, and <ttl> is the 'time to live' of this cache entry (in script, and <ttl> is the 'time to live' of this cache entry (in
units of seconds). units of seconds).
Note: If <ip address> is invalid, say the string "0", then a negative .. note::
If <ip address> is invalid, say the string "0", then a negative
entry is created, which will cause the kernel to treat the hostname entry is created, which will cause the kernel to treat the hostname
as having no valid DNS translation. as having no valid DNS translation.
...@@ -103,26 +108,27 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual ...@@ -103,26 +108,27 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
A basic sample /sbin/nfs_cache_getent A basic sample /sbin/nfs_cache_getent
===================================== =====================================
.. code-block:: sh
#!/bin/bash
# #!/bin/bash
ttl=600 #
# ttl=600
cut=/usr/bin/cut #
getent=/usr/bin/getent cut=/usr/bin/cut
rpc_pipefs=/var/lib/nfs/rpc_pipefs getent=/usr/bin/getent
# rpc_pipefs=/var/lib/nfs/rpc_pipefs
die() #
{ die()
{
echo "Usage: $0 cache_name entry_name" echo "Usage: $0 cache_name entry_name"
exit 1 exit 1
} }
[ $# -lt 2 ] && die [ $# -lt 2 ] && die
cachename="$1" cachename="$1"
cache_path=${rpc_pipefs}/cache/${cachename}/channel cache_path=${rpc_pipefs}/cache/${cachename}/channel
case "${cachename}" in case "${cachename}" in
dns_resolve) dns_resolve)
name="$2" name="$2"
result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )" result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )"
...@@ -131,6 +137,5 @@ case "${cachename}" in ...@@ -131,6 +137,5 @@ case "${cachename}" in
*) *)
die die
;; ;;
esac esac
echo "${result} ${name} ${ttl}" >${cache_path} echo "${result} ${name} ${ttl}" >${cache_path}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment