aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-04-06 12:44:34 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-04-06 12:44:34 +0000
commita046da7e90052bb30679ae1f0f1c3187d7a5aaee (patch)
tree22be7ff3ec43118ca8914e2be7edb0dc8d4d70ca
parent480e2fd3d56f61ba83ee7aa04bd14bbc0a07aa3e (diff)
downloadsrc-a046da7e90052bb30679ae1f0f1c3187d7a5aaee.tar.gz
src-a046da7e90052bb30679ae1f0f1c3187d7a5aaee.zip
Remove spl*() calls from the nfsclient code. Style adjustments in the
related lines in ncl_writebp(). Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes
Notes: svn path=/head/; revision=316566
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c4
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c9
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c32
3 files changed, 10 insertions, 35 deletions
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index 083da69bbc0d..df3aea9681bb 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -1811,9 +1811,6 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
*/
if (error == EINTR || error == EIO || error == ETIMEDOUT
|| (!error && (bp->b_flags & B_NEEDCOMMIT))) {
- int s;
-
- s = splbio();
bp->b_flags &= ~(B_INVAL|B_NOCACHE);
if ((bp->b_flags & B_PAGING) == 0) {
bdirty(bp);
@@ -1822,7 +1819,6 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
if ((error == EINTR || error == ETIMEDOUT) &&
(bp->b_flags & B_ASYNC) == 0)
bp->b_flags |= B_EINTR;
- splx(s);
} else {
if (error) {
bp->b_ioflags |= BIO_ERROR;
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 7c460c5355ae..0698c2d1b34d 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -415,11 +415,6 @@ nfs_mountroot(struct mount *mp)
nfs_convert_diskless();
/*
- * XXX splnet, so networks will receive...
- */
- splnet();
-
- /*
* Do enough of ifconfig(8) so that the critical net interface can
* talk to the server.
*/
@@ -558,12 +553,9 @@ static void
nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
const char *hostname, struct ucred *cred, struct thread *td)
{
- int s;
int adjsock;
char *p;
- s = splnet();
-
/*
* Set read-only flag if requested; otherwise, clear it if this is
* an update. If this is not an update, then either the read-only
@@ -609,7 +601,6 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
/* Update flags atomically. Don't change the lock bits. */
nmp->nm_flag = argp->flags | nmp->nm_flag;
- splx(s);
if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) {
nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10;
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 672730d0c911..30227ff82a50 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -3167,27 +3167,21 @@ nfs_print(struct vop_print_args *ap)
int
ncl_writebp(struct buf *bp, int force __unused, struct thread *td)
{
- int s;
- int oldflags = bp->b_flags;
-#if 0
- int retv = 1;
- off_t off;
-#endif
+ int oldflags, rtval;
BUF_ASSERT_HELD(bp);
if (bp->b_flags & B_INVAL) {
brelse(bp);
- return(0);
+ return (0);
}
+ oldflags = bp->b_flags;
bp->b_flags |= B_CACHE;
/*
* Undirty the bp. We will redirty it later if the I/O fails.
*/
-
- s = splbio();
bundirty(bp);
bp->b_flags &= ~B_DONE;
bp->b_ioflags &= ~BIO_ERROR;
@@ -3195,7 +3189,6 @@ ncl_writebp(struct buf *bp, int force __unused, struct thread *td)
bufobj_wref(bp->b_bufobj);
curthread->td_ru.ru_oublock++;
- splx(s);
/*
* Note: to avoid loopback deadlocks, we do not
@@ -3207,19 +3200,14 @@ ncl_writebp(struct buf *bp, int force __unused, struct thread *td)
bp->b_iooffset = dbtob(bp->b_blkno);
bstrategy(bp);
- if( (oldflags & B_ASYNC) == 0) {
- int rtval = bufwait(bp);
-
- if (oldflags & B_DELWRI) {
- s = splbio();
- reassignbuf(bp);
- splx(s);
- }
- brelse(bp);
- return (rtval);
- }
+ if ((oldflags & B_ASYNC) != 0)
+ return (0);
- return (0);
+ rtval = bufwait(bp);
+ if (oldflags & B_DELWRI)
+ reassignbuf(bp);
+ brelse(bp);
+ return (rtval);
}
/*