]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/nfs/nfs_node.c
xnu-3789.41.3.tar.gz
[apple/xnu.git] / bsd / nfs / nfs_node.c
index fe04bd5877e27349ff79a7d383940fc540f97cc2..4372429196c416e0cbc2e83f3307d0a9ef04ab3b 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- * 
+ *
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  * unlawful or unlicensed copies of an Apple operating system, or to
  * circumvent, violate, or enable the circumvention or violation of, any
  * terms of an Apple operating system software license agreement.
- * 
+ *
  * Please obtain a copy of the License at
  * http://www.opensource.apple.com/apsl/ and read it before using this file.
- * 
+ *
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
@@ -22,7 +22,7 @@
  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  * Please see the License for the specific language governing rights and
  * limitations under the License.
- * 
+ *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
@@ -145,7 +145,7 @@ nfs_case_insensitive(mount_t mp)
        int answer = 0;
        int skip = 0;
        
-       if (nmp == NULL) {
+       if (nfs_mount_gone(nmp)) {
                return (0);
        }
        
@@ -168,7 +168,7 @@ nfs_case_insensitive(mount_t mp)
                skip = 1;
        }
 
-       if (!skip && NFS_BITMAP_ISSET(nmp->nm_fsattr.nfsa_bitmap, NFS_FATTR_CASE_INSENSITIVE))
+       if (!skip && (nmp->nm_fsattr.nfsa_flags & NFS_FSFLAG_CASE_INSENSITIVE))
                answer = 1;
 
        lck_mtx_unlock(&nmp->nm_lock);
@@ -207,7 +207,7 @@ nfs_nget(
        FSDBG_TOP(263, mp, dnp, flags, npp);
 
        /* Check for unmount in progress */
-       if (!mp || (mp->mnt_kern_flag & MNTK_FRCUNMOUNT)) {
+       if (!mp || vfs_isforce(mp)) {
                *npp = NULL;
                error = ENXIO;
                FSDBG_BOT(263, mp, dnp, 0xd1e, error);
@@ -353,8 +353,8 @@ loop:
                                if (vnode_parent(vp) != NFSTOV(dnp))
                                        update_flags |= VNODE_UPDATE_PARENT;
                                if (update_flags) {
-                                       NFS_NODE_DBG("vnode_update_identity old name %s new name %*s\n",
-                                                    vp->v_name, cnp->cn_namelen, cnp->cn_nameptr ? cnp->cn_nameptr : "");
+                                       NFS_NODE_DBG("vnode_update_identity old name %s new name %.*s update flags = %x\n",
+                                                    vp->v_name, cnp->cn_namelen, cnp->cn_nameptr ? cnp->cn_nameptr : "", update_flags);
                                        vnode_update_identity(vp, NFSTOV(dnp), cnp->cn_nameptr, cnp->cn_namelen, 0, update_flags);
                                }
                        }
@@ -582,12 +582,12 @@ loop:
 
 
 int
-nfs_vnop_inactive(ap)
+nfs_vnop_inactive(
        struct vnop_inactive_args /* {
                struct vnodeop_desc *a_desc;
                vnode_t a_vp;
                vfs_context_t a_context;
-       } */ *ap;
+       } */ *ap)
 {
        vnode_t vp = ap->a_vp;
        vfs_context_t ctx = ap->a_context;
@@ -610,7 +610,7 @@ nfs_vnop_inactive(ap)
        mp = vnode_mount(vp);
 
 restart:
-       force = (!mp || (mp->mnt_kern_flag & MNTK_FRCUNMOUNT));
+       force = (!mp || vfs_isforce(mp));
        error = 0;
        inuse = (nfs_mount_state_in_use_start(nmp, NULL) == 0);
 
@@ -851,12 +851,12 @@ restart:
  * Reclaim an nfsnode so that it can be used for other purposes.
  */
 int
-nfs_vnop_reclaim(ap)
+nfs_vnop_reclaim(
        struct vnop_reclaim_args /* {
                struct vnodeop_desc *a_desc;
                vnode_t a_vp;
                vfs_context_t a_context;
-       } */ *ap;
+       } */ *ap)
 {
        vnode_t vp = ap->a_vp;
        nfsnode_t np = VTONFS(vp);
@@ -869,7 +869,7 @@ nfs_vnop_reclaim(ap)
        int force;
 
        FSDBG_TOP(265, vp, np, np->n_flag, 0);
-       force = (!mp || (mp->mnt_kern_flag & MNTK_FRCUNMOUNT));
+       force = (!mp || vfs_isforce(mp) || nfs_mount_gone(nmp));
 
        /* There shouldn't be any open or lock state at this point */
        lck_mtx_lock(&np->n_openlock);