summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/fs/nfsclient/nfs.h1
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c105
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c6
3 files changed, 8 insertions, 104 deletions
diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h
index 8029a00..a72ec6d 100644
--- a/sys/fs/nfsclient/nfs.h
+++ b/sys/fs/nfsclient/nfs.h
@@ -67,7 +67,6 @@ int ncl_vinvalbuf(struct vnode *, int, struct thread *, int);
int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *,
struct thread *);
int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *);
-int ncl_msleep(struct thread *, void *, struct mtx *, int, char *, int);
void ncl_nhinit(void);
void ncl_nhuninit(void);
void ncl_nodelock(struct nfsnode *);
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index 030e322..3193822 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -75,101 +75,6 @@ static int nfs_directio_write(struct vnode *vp, struct uio *uiop,
struct ucred *cred, int ioflag);
/*
- * Any signal that can interrupt an NFS operation in an intr mount
- * should be added to this set. SIGSTOP and SIGKILL cannot be masked.
- */
-static int nfs_sig_set[] = {
- SIGINT,
- SIGTERM,
- SIGHUP,
- SIGKILL,
- SIGSTOP,
- SIGQUIT
-};
-
-#ifdef notnow
-/*
- * Check to see if one of the signals in our subset is pending on
- * the process (in an intr mount).
- */
-int
-ncl_sig_pending(sigset_t set)
-{
- int i;
-
- for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++)
- if (SIGISMEMBER(set, nfs_sig_set[i]))
- return (1);
- return (0);
-}
-#endif
-
-/*
- * The set/restore sigmask functions are used to (temporarily) overwrite
- * the process p_sigmask during an RPC call (for example). These are also
- * used in other places in the NFS client that might tsleep().
- */
-static void
-ncl_set_sigmask(struct thread *td, sigset_t *oldset)
-{
- sigset_t newset;
- int i;
- struct proc *p;
-
- SIGFILLSET(newset);
- if (td == NULL)
- td = curthread; /* XXX */
- p = td->td_proc;
- /* Remove the NFS set of signals from newset */
- PROC_LOCK(p);
- mtx_lock(&p->p_sigacts->ps_mtx);
- for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) {
- /*
- * But make sure we leave the ones already masked
- * by the process, ie. remove the signal from the
- * temporary signalmask only if it wasn't already
- * in p_sigmask.
- */
- if (!SIGISMEMBER(td->td_sigmask, nfs_sig_set[i]) &&
- !SIGISMEMBER(p->p_sigacts->ps_sigignore, nfs_sig_set[i]))
- SIGDELSET(newset, nfs_sig_set[i]);
- }
- mtx_unlock(&p->p_sigacts->ps_mtx);
- PROC_UNLOCK(p);
- kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0);
-}
-
-static void
-ncl_restore_sigmask(struct thread *td, sigset_t *set)
-{
- if (td == NULL)
- td = curthread; /* XXX */
- kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0);
-}
-
-/*
- * NFS wrapper to msleep(), that shoves a new p_sigmask and restores the
- * old one after msleep() returns.
- */
-int
-ncl_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo)
-{
- sigset_t oldset;
- int error;
- struct proc *p;
-
- if ((priority & PCATCH) == 0)
- return msleep(ident, mtx, priority, wmesg, timo);
- if (td == NULL)
- td = curthread; /* XXX */
- ncl_set_sigmask(td, &oldset);
- error = msleep(ident, mtx, priority, wmesg, timo);
- ncl_restore_sigmask(td, &oldset);
- p = td->td_proc;
- return (error);
-}
-
-/*
* Vnode op for VM getpages.
*/
int
@@ -1356,9 +1261,9 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
if (nmp->nm_flag & NFSMNT_INT) {
sigset_t oldset;
- ncl_set_sigmask(td, &oldset);
+ newnfs_set_sigmask(td, &oldset);
bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0);
- ncl_restore_sigmask(td, &oldset);
+ newnfs_restore_sigmask(td, &oldset);
while (bp == NULL) {
if (newnfs_sigintr(nmp, td))
return (NULL);
@@ -1544,9 +1449,9 @@ again:
NFS_DPF(ASYNCIO,
("ncl_asyncio: waiting for mount %p queue to drain\n", nmp));
nmp->nm_bufqwant = TRUE;
- error = ncl_msleep(td, &nmp->nm_bufq, &ncl_iod_mutex,
- slpflag | PRIBIO,
- "nfsaio", slptimeo);
+ error = newnfs_msleep(td, &nmp->nm_bufq,
+ &ncl_iod_mutex, slpflag | PRIBIO, "nfsaio",
+ slptimeo);
if (error) {
error2 = newnfs_sigintr(nmp, td);
if (error2) {
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 5436c8b..251966d 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -2708,9 +2708,9 @@ loop:
mtx_lock(&np->n_mtx);
while (np->n_directio_asyncwr > 0) {
np->n_flag |= NFSYNCWAIT;
- error = ncl_msleep(td, (caddr_t)&np->n_directio_asyncwr,
- &np->n_mtx, slpflag | (PRIBIO + 1),
- "nfsfsync", 0);
+ error = newnfs_msleep(td, &np->n_directio_asyncwr,
+ &np->n_mtx, slpflag | (PRIBIO + 1),
+ "nfsfsync", 0);
if (error) {
if (newnfs_sigintr(nmp, td)) {
mtx_unlock(&np->n_mtx);
OpenPOWER on IntegriCloud