Author: kib
Date: Thu Apr  6 12:44:34 2017
New Revision: 316566
URL: https://svnweb.freebsd.org/changeset/base/316566

Log:
  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

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clbio.c   Thu Apr  6 10:52:52 2017        
(r316565)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Thu Apr  6 12:44:34 2017        
(r316566)
@@ -1811,9 +1811,6 @@ ncl_doio(struct vnode *vp, struct buf *b
                 */
                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 *b
                        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;

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c        Thu Apr  6 10:52:52 2017        
(r316565)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c        Thu Apr  6 12:44:34 2017        
(r316566)
@@ -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
 
        /* 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;

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c Thu Apr  6 10:52:52 2017        
(r316565)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Apr  6 12:44:34 2017        
(r316566)
@@ -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 __
 
        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 __
        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);
 }
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to