Set up a projects branch for NFSv4.1 client enhancements to NFS.
Add the NFS client changes for a basic NFSv4.1 client. This
includes support for sessions for both fore and back channels,
creation of a ClientID the NFSv4.1 way and code that avoids
using NFSv4.0 operations defined as "mandatory to not implement"
for NFSv4.1. It includes handling of NFSv4.1 callbacks via
a callback session. It does not include the new NFSv4.1 optional
features like pNFS, but does allow the client to work with an
NFSv4.1 server and creates the base on which pNFS can be implemented.
The new operations are not counted in the nfsstats structure,
since it needs to remain the same size, so that the nfsstats
command will still work. It adds a new mount option called
"minvers" which can be used to specify an NFSv4.1 mount.
For example: "mount -t nfs -o nfsv4,minvers=1 <server>:/ /<path>
Changes to sys/rpc are required before this will build/work.
Move a couple of the kernel rpc structures into a private
include file from the C files, so that they can be included
in multiple files.
Define a new CLSET_BACKCHANNEL for the kernel rpc. This can
be used to set up a backchannel on a TCP RPC socket. A backchannel
allows RPC messages to travel in the opposite direction, with
an RPC request from the server to client and an RPC reply
from the client to server. This is used by NFSv4.1 for callback RPCs.
Add code to handle CLSET_BACKCHANNEL. Basically, just save the xprt
returned by svc_vc_create_backchannel() and pass it down to the
clnt_vc layer. Struct rc_data is now in _krpc.h.
Modify the TCP RPC client code to handle the backchannel. The main
change is to recognize the case of an RPC request (CALL) message
in the receive upcall and marshalling it to the server via the
xprt structure in ct_backchannelxprt. The locking is:
- ct_lock protects the ct_backchannelxprt field along with other ct_data
  fields and is held during most of the backchannel changes.
- xp_lock protects the fields inside the xprt structure and must be
  held when the structure is being released in clnt_vc_destroy().
The ct_request and ct_data structures are now defined in _krpc.h.
Add the backchannel methods and svc_vc_create_backchannel() to
the server side kernel RPC, so that a backchannel xprt structure
can be created and used to handle RPC requests received by the
clnt_vc receive upcall. Once the RPC request is marshalled to
the server using the xprt structure, it is handled like any other
server side RPC, with the reply being sent on the clnt_vc socket.
Merge in an up to date kernel from head.
Move session related fields out of the nfsclclient and nfsmount
structures and into a separate structure. This will help prepare
the session code so that it can be used for Data Server (DS)
connections as well as the Metadata Server (MDS) connection.
Modify the nfscl_setsequence() and nfscl_freeslot() functions so
that they use the new nfsclsession structure. Also, rename and
move them to the common module, since they are called by code
in the common module and may be useful for a NFSv4.1 server someday.
Add an argument to nfscl_reqstart() that is a pointer to the
new session structure, so that it can optionally override use
of the default one in the nfsclclient structure. For now, this
new argument is always passed in as NULL to maintain default
behaviour.
Modify the nfsrpc_exchangeid() and nfsrpc_createsession() functions
to use the new session structure. Later these functions will get
extra arguments that will allow them to use a session structure
other than the default one in the nfsclclient structure.
Initialize the mutex in the nfsclsession structure inside the
nfsclclient structure. This mutex is used to serialize modifications
of fields in the nfsclsession structure.
Add an optional argument to newnfs_request() that is a pointer to
the new session structure. If this argument is NULL, it will use
the default session structure in the nfsclclient structure. This
prepares the code to be used for Data Server sessions as well as
the default Metadata Server session.
Add an argument to nfsrpc_exchangeid() to specify the exchange flags
to be used.
Add the "glue" needed for the 4 NFSv4.1 Ops that are used for
handling NFSV4.1 pNFS layouts. This also includes flags and
error return values used by these Operations.
The functions that implement
these operations will be coming soon.
Define the structure that stores an NFSv4.1 File Layout and add
the function nfsrpc_layoutget() that does the LayoutGet Operation
to fill it in. The function is untested at this point and the
structure may need to change.
Redefine the NFSv4.1 File Layout structure as 2 structures, where
the second one chains off the first in increasing offset order.
This is necessary since the stateid changes for each LayoutGet
Op. and the most up-to-date one must be used. It also simplified
the coding of nfsrpc_layoutget().
This function is still untested and it, along with the structures
will continue to change for a while.
Add the function that does the GetDeviceInfo NFSv4.1 operation and
stores the file layout in "struct nfsclfldevinfo". Also, add a function
that can parse netaddr4 XDR structures for both IPv4 and IPv6, which
is needed by nfsrpc_getdeviceinfo(). The nfsrpc_getdeviceinfo() function
is not yet tested and it, plus "struct nfsclfldevinfo", could change.
Fix up "struct nfsclfldevinfo" and the inline functions that use it.
Basically, redefine nfsdi_data[] as an array of "struct sockaddr_storage"
to avoid alignment/packing issues.