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
This commit is contained in:
Konstantin Belousov 2017-04-06 12:44:34 +00:00
parent 480e2fd3d5
commit a046da7e90
3 changed files with 10 additions and 35 deletions

View File

@ -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;

View File

@ -414,11 +414,6 @@ nfs_mountroot(struct mount *mp)
if (nfs_diskless_valid == 1)
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;

View File

@ -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_ASYNC) != 0)
return (0);
if (oldflags & B_DELWRI) {
s = splbio();
reassignbuf(bp);
splx(s);
}
brelse(bp);
return (rtval);
}
return (0);
rtval = bufwait(bp);
if (oldflags & B_DELWRI)
reassignbuf(bp);
brelse(bp);
return (rtval);
}
/*