mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
Adjust the internal NFS KPI to avoid the last traces of NFS_LEGACYRPC.
Approved by: re
This commit is contained in:
parent
b49a2b39fd
commit
98c497255b
5 changed files with 21 additions and 26 deletions
|
|
@ -147,11 +147,6 @@ extern int nfsv3_procid[NFS_NPROCS];
|
|||
(e) != ERESTART && (e) != EWOULDBLOCK && \
|
||||
((s) & PR_CONNREQUIRED) == 0)
|
||||
|
||||
/*
|
||||
* This is only needed to keep things working while we support
|
||||
* compiling for both RPC implementations.
|
||||
*/
|
||||
struct nfsreq;
|
||||
struct nfsmount;
|
||||
|
||||
struct buf;
|
||||
|
|
@ -262,7 +257,7 @@ int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *
|
|||
int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *);
|
||||
void nfs_doio_directwrite (struct buf *);
|
||||
int nfs_readlinkrpc(struct vnode *, struct uio *, struct ucred *);
|
||||
int nfs_sigintr(struct nfsmount *, struct nfsreq *, struct thread *);
|
||||
int nfs_sigintr(struct nfsmount *, struct thread *);
|
||||
int nfs_readdirplusrpc(struct vnode *, struct uio *, struct ucred *);
|
||||
int nfs_request(struct vnode *, struct mbuf *, int, struct thread *,
|
||||
struct ucred *, struct mbuf **, struct mbuf **, caddr_t *);
|
||||
|
|
@ -274,7 +269,7 @@ void nfs_nhuninit(void);
|
|||
int nfs_nmcancelreqs(struct nfsmount *);
|
||||
void nfs_timer(void*);
|
||||
|
||||
int nfs_connect(struct nfsmount *, struct nfsreq *);
|
||||
int nfs_connect(struct nfsmount *);
|
||||
void nfs_disconnect(struct nfsmount *);
|
||||
void nfs_safedisconnect(struct nfsmount *);
|
||||
int nfs_getattrcache(struct vnode *, struct vattr *);
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
|
|||
if (incore(&vp->v_bufobj, rabn) == NULL) {
|
||||
rabp = nfs_getcacheblk(vp, rabn, biosize, td);
|
||||
if (!rabp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
return (error ? error : EINTR);
|
||||
}
|
||||
if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) {
|
||||
|
|
@ -535,7 +535,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
|
|||
bp = nfs_getcacheblk(vp, lbn, bcount, td);
|
||||
|
||||
if (!bp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
return (error ? error : EINTR);
|
||||
}
|
||||
|
||||
|
|
@ -570,7 +570,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
|
|||
nfsstats.biocache_readlinks++;
|
||||
bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td);
|
||||
if (!bp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
return (error ? error : EINTR);
|
||||
}
|
||||
if ((bp->b_flags & B_CACHE) == 0) {
|
||||
|
|
@ -596,7 +596,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
|
|||
on = uio->uio_offset & (NFS_DIRBLKSIZ - 1);
|
||||
bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, td);
|
||||
if (!bp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
return (error ? error : EINTR);
|
||||
}
|
||||
if ((bp->b_flags & B_CACHE) == 0) {
|
||||
|
|
@ -625,7 +625,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
|
|||
return (0);
|
||||
bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, td);
|
||||
if (!bp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
return (error ? error : EINTR);
|
||||
}
|
||||
if ((bp->b_flags & B_CACHE) == 0) {
|
||||
|
|
@ -1080,7 +1080,7 @@ again:
|
|||
}
|
||||
|
||||
if (!bp) {
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
if (!error)
|
||||
error = EINTR;
|
||||
break;
|
||||
|
|
@ -1257,7 +1257,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
|
|||
bp = getblk(vp, bn, size, PCATCH, 0, 0);
|
||||
nfs_restore_sigmask(td, &oldset);
|
||||
while (bp == NULL) {
|
||||
if (nfs_sigintr(nmp, NULL, td))
|
||||
if (nfs_sigintr(nmp, td))
|
||||
return (NULL);
|
||||
bp = getblk(vp, bn, size, 0, 2 * hz, 0);
|
||||
}
|
||||
|
|
@ -1321,13 +1321,13 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg)
|
|||
* Not doing so, we run the risk of losing dirty pages in the
|
||||
* vinvalbuf() call below.
|
||||
*/
|
||||
if (intrflg && (error = nfs_sigintr(nmp, NULL, td)))
|
||||
if (intrflg && (error = nfs_sigintr(nmp, td)))
|
||||
goto out;
|
||||
}
|
||||
|
||||
error = vinvalbuf(vp, flags, slpflag, 0);
|
||||
while (error) {
|
||||
if (intrflg && (error = nfs_sigintr(nmp, NULL, td)))
|
||||
if (intrflg && (error = nfs_sigintr(nmp, td)))
|
||||
goto out;
|
||||
error = vinvalbuf(vp, flags, 0, slptimeo);
|
||||
}
|
||||
|
|
@ -1434,7 +1434,7 @@ again:
|
|||
slpflag | PRIBIO,
|
||||
"nfsaio", slptimeo);
|
||||
if (error) {
|
||||
error2 = nfs_sigintr(nmp, NULL, td);
|
||||
error2 = nfs_sigintr(nmp, td);
|
||||
if (error2) {
|
||||
mtx_unlock(&nfs_iod_mtx);
|
||||
return (error2);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ nfs_init_rtt(struct nfsmount *nmp)
|
|||
* We do not free the sockaddr if error.
|
||||
*/
|
||||
int
|
||||
nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
|
||||
nfs_connect(struct nfsmount *nmp)
|
||||
{
|
||||
int rcvreserve, sndreserve;
|
||||
int pktscale;
|
||||
|
|
@ -511,7 +511,7 @@ nfs_request(struct vnode *vp, struct mbuf *mreq, int procnum,
|
|||
* and let clnt_reconnect_create handle reconnects.
|
||||
*/
|
||||
if (!nmp->nm_client)
|
||||
nfs_connect(nmp, NULL);
|
||||
nfs_connect(nmp);
|
||||
|
||||
auth = nfs_getauth(nmp, cred);
|
||||
if (!auth) {
|
||||
|
|
@ -799,7 +799,7 @@ nfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *
|
|||
* This is used for NFSMNT_INT mounts.
|
||||
*/
|
||||
int
|
||||
nfs_sigintr(struct nfsmount *nmp, struct nfsreq *rep, struct thread *td)
|
||||
nfs_sigintr(struct nfsmount *nmp, struct thread *td)
|
||||
{
|
||||
struct proc *p;
|
||||
sigset_t tmpset;
|
||||
|
|
|
|||
|
|
@ -730,7 +730,7 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
|
|||
if (nmp->nm_client && adjsock) {
|
||||
nfs_safedisconnect(nmp);
|
||||
if (nmp->nm_sotype == SOCK_DGRAM)
|
||||
while (nfs_connect(nmp, NULL)) {
|
||||
while (nfs_connect(nmp)) {
|
||||
printf("nfs_args: retrying connect\n");
|
||||
(void) tsleep(&fake_wchan, PSOCK, "nfscon", hz);
|
||||
}
|
||||
|
|
@ -1229,7 +1229,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
|
|||
* the first request, in case the server is not responding.
|
||||
*/
|
||||
if (nmp->nm_sotype == SOCK_DGRAM &&
|
||||
(error = nfs_connect(nmp, NULL)))
|
||||
(error = nfs_connect(nmp)))
|
||||
goto bad;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -3128,7 +3128,7 @@ loop:
|
|||
error = 0;
|
||||
goto loop;
|
||||
}
|
||||
if (nfs_sigintr(nmp, NULL, td)) {
|
||||
if (nfs_sigintr(nmp, td)) {
|
||||
error = EINTR;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -3151,7 +3151,7 @@ loop:
|
|||
else
|
||||
bp->b_flags |= B_ASYNC;
|
||||
bwrite(bp);
|
||||
if (nfs_sigintr(nmp, NULL, td)) {
|
||||
if (nfs_sigintr(nmp, td)) {
|
||||
error = EINTR;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -3167,7 +3167,7 @@ loop:
|
|||
error = bufobj_wwait(bo, slpflag, slptimeo);
|
||||
if (error) {
|
||||
BO_UNLOCK(bo);
|
||||
error = nfs_sigintr(nmp, NULL, td);
|
||||
error = nfs_sigintr(nmp, td);
|
||||
if (error)
|
||||
goto done;
|
||||
if (slpflag == PCATCH) {
|
||||
|
|
@ -3192,7 +3192,7 @@ loop:
|
|||
&np->n_mtx, slpflag | (PRIBIO + 1),
|
||||
"nfsfsync", 0);
|
||||
if (error) {
|
||||
if (nfs_sigintr(nmp, NULL, td)) {
|
||||
if (nfs_sigintr(nmp, td)) {
|
||||
mtx_unlock(&np->n_mtx);
|
||||
error = EINTR;
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Reference in a new issue