svn commit: r362601 - in projects/nfs-over-tls/sys/fs: nfs nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Thu Jun 25 02:00:52 UTC 2020
Author: rmacklem
Date: Thu Jun 25 02:00:51 2020
New Revision: 362601
URL: https://svnweb.freebsd.org/changeset/base/362601
Log:
Move nfsm_trimtrailing() to nfs_nfsdsubs.c, since it is only used by the
NFS server.
Also, delete the definition of newnfs_trimtrailing(), since it no longer
exists.
Modified:
projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c
projects/nfs-over-tls/sys/fs/nfs/nfs_var.h
projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c
Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Thu Jun 25 00:18:42 2020 (r362600)
+++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Thu Jun 25 02:00:51 2020 (r362601)
@@ -1060,44 +1060,6 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2)
}
/*
- * Trim trailing data off the mbuf list being built.
- */
-void
-nfsm_trimtrailing(struct nfsrv_descript *nd, struct mbuf *mb, char *bpos,
- int bextpg, int bextpgsiz)
-{
- vm_page_t pg;
- int fullpgsiz, i;
-
- if (mb->m_next != NULL) {
- m_freem(mb->m_next);
- mb->m_next = NULL;
- }
- if ((mb->m_flags & M_EXTPG) != 0) {
- /* First, get rid of any pages after this position. */
- for (i = mb->m_epg_npgs - 1; i > bextpg; i--) {
- pg = PHYS_TO_VM_PAGE(mb->m_epg_pa[i]);
- vm_page_unwire_noq(pg);
- vm_page_free(pg);
- }
- mb->m_epg_npgs = bextpg + 1;
- if (bextpg == 0)
- fullpgsiz = PAGE_SIZE - mb->m_epg_1st_off;
- else
- fullpgsiz = PAGE_SIZE;
- mb->m_epg_last_len = fullpgsiz - bextpgsiz;
- mb->m_len = m_epg_pagelen(mb, 0, mb->m_epg_1st_off);
- for (i = 1; i < mb->m_epg_npgs; i++)
- mb->m_len += m_epg_pagelen(mb, i, 0);
- nd->nd_bextpgsiz = bextpgsiz;
- nd->nd_bextpg = bextpg;
- } else
- mb->m_len = bpos - mtod(mb, char *);
- nd->nd_mb = mb;
- nd->nd_bpos = bpos;
-}
-
-/*
* Dissect a file handle on the client.
*/
int
Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_var.h
==============================================================================
--- projects/nfs-over-tls/sys/fs/nfs/nfs_var.h Thu Jun 25 00:18:42 2020 (r362600)
+++ projects/nfs-over-tls/sys/fs/nfs/nfs_var.h Thu Jun 25 02:00:51 2020 (r362601)
@@ -325,10 +325,6 @@ int nfsm_mbufuio(struct nfsrv_descript *, struct uio *
int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int);
int nfsm_advance(struct nfsrv_descript *, int, int);
void *nfsm_dissct(struct nfsrv_descript *, int, int);
-void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *,
- caddr_t, int, int);
-void newnfs_trimtrailing(struct nfsrv_descript *, struct mbuf *,
- caddr_t);
void newnfs_copycred(struct nfscred *, struct ucred *);
void newnfs_copyincred(struct ucred *, struct nfscred *);
int nfsrv_dissectacl(struct nfsrv_descript *, NFSACL_T *, int *,
@@ -413,6 +409,8 @@ void nfsd_init(void);
int nfsd_checkrootexp(struct nfsrv_descript *);
void nfsd_getminorvers(struct nfsrv_descript *, u_char *, u_char **, int *,
u_int32_t *);
+void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *,
+ caddr_t, int, int);
/* nfs_clvfsops.c */
void nfscl_retopts(struct nfsmount *, char *, size_t);
Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c
==============================================================================
--- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Jun 25 00:18:42 2020 (r362600)
+++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Jun 25 02:00:51 2020 (r362601)
@@ -2174,3 +2174,41 @@ nfsmout:
*taglenp = taglen;
}
+/*
+ * Trim trailing data off the mbuf list being built.
+ */
+void
+nfsm_trimtrailing(struct nfsrv_descript *nd, struct mbuf *mb, char *bpos,
+ int bextpg, int bextpgsiz)
+{
+ vm_page_t pg;
+ int fullpgsiz, i;
+
+ if (mb->m_next != NULL) {
+ m_freem(mb->m_next);
+ mb->m_next = NULL;
+ }
+ if ((mb->m_flags & M_EXTPG) != 0) {
+ /* First, get rid of any pages after this position. */
+ for (i = mb->m_epg_npgs - 1; i > bextpg; i--) {
+ pg = PHYS_TO_VM_PAGE(mb->m_epg_pa[i]);
+ vm_page_unwire_noq(pg);
+ vm_page_free(pg);
+ }
+ mb->m_epg_npgs = bextpg + 1;
+ if (bextpg == 0)
+ fullpgsiz = PAGE_SIZE - mb->m_epg_1st_off;
+ else
+ fullpgsiz = PAGE_SIZE;
+ mb->m_epg_last_len = fullpgsiz - bextpgsiz;
+ mb->m_len = m_epg_pagelen(mb, 0, mb->m_epg_1st_off);
+ for (i = 1; i < mb->m_epg_npgs; i++)
+ mb->m_len += m_epg_pagelen(mb, i, 0);
+ nd->nd_bextpgsiz = bextpgsiz;
+ nd->nd_bextpg = bextpg;
+ } else
+ mb->m_len = bpos - mtod(mb, char *);
+ nd->nd_mb = mb;
+ nd->nd_bpos = bpos;
+}
+
More information about the svn-src-projects
mailing list