svn commit: r361146 - in head/sys/fs: nfs nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Mon May 18 00:07:46 UTC 2020
Author: rmacklem
Date: Mon May 18 00:07:45 2020
New Revision: 361146
URL: https://svnweb.freebsd.org/changeset/base/361146
Log:
Add a function nfsm_set() to initialize "struct nfsrv_descript" for building
mbuf lists.
This function is currently trivial, but will that will change when
support for building NFS messages in ext_pgs mbufs is added.
Adding support for ext_pgs mbufs is needed for KERN_TLS, which will
be used to implement nfs-over-tls.
Modified:
head/sys/fs/nfs/nfs_commonsubs.c
head/sys/fs/nfs/nfs_var.h
head/sys/fs/nfsserver/nfs_nfsdport.c
Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c Sun May 17 22:31:38 2020 (r361145)
+++ head/sys/fs/nfs/nfs_commonsubs.c Mon May 18 00:07:45 2020 (r361146)
@@ -4778,3 +4778,14 @@ nfsv4_findmirror(struct nfsmount *nmp)
return (ds);
}
+/*
+ * Fill in the fields of "struct nfsrv_descript".
+ */
+void
+nfsm_set(struct nfsrv_descript *nd, u_int offs)
+{
+ struct mbuf *m;
+
+ m = nd->nd_mb;
+ nd->nd_bpos = mtod(m, char *) + offs;
+}
Modified: head/sys/fs/nfs/nfs_var.h
==============================================================================
--- head/sys/fs/nfs/nfs_var.h Sun May 17 22:31:38 2020 (r361145)
+++ head/sys/fs/nfs/nfs_var.h Mon May 18 00:07:45 2020 (r361146)
@@ -360,6 +360,7 @@ int nfsv4_sequencelookup(struct nfsmount *, struct nfs
void nfsv4_freeslot(struct nfsclsession *, int);
struct ucred *nfsrv_getgrpscred(struct ucred *);
struct nfsdevice *nfsv4_findmirror(struct nfsmount *);
+void nfsm_set(struct nfsrv_descript *, u_int);
/* nfs_clcomsubs.c */
void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 17 22:31:38 2020 (r361145)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon May 18 00:07:45 2020 (r361146)
@@ -5080,7 +5080,7 @@ nfsrv_writedsdorpc(struct nfsmount *nmp, fhandle_t *fh
while (m->m_next != NULL)
m = m->m_next;
nd->nd_mb = m;
- nd->nd_bpos = mtod(m, char *) + m->m_len;
+ nfsm_set(nd, m->m_len);
NFSD_DEBUG(4, "nfsrv_writedsdorpc: lastmb len=%d\n", m->m_len);
/* Do a Getattr for the attributes that change upon writing. */
More information about the svn-src-head
mailing list