]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_cnode.c
xnu-792.24.17.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_cnode.c
index 6b9c45f33161284110f61cb3059c29d3c7c987da..132b17cc2e2c7ba3cc0afd73514496e9048f1d96 100644 (file)
@@ -1,31 +1,23 @@
 /*
  * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
+ * @APPLE_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 
- * compliance with the License.  The rights granted to you under the 
- * License may not be used to create, or enable the creation or 
- * redistribution of, 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, 
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 
- * 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_LICENSE_OSREFERENCE_HEADER_END@
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License").  You may not use this file except in compliance with the
+ * License.  Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
+ * 
+ * This 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,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1003,8 +995,7 @@ void
 hfs_unlock(struct cnode *cp)
 {
         vnode_t rvp = NULLVP;
-        vnode_t vp = NULLVP;
-       u_int32_t c_flag;
+        vnode_t dvp = NULLVP;
 
        /* System files need to keep track of owner */
        if ((cp->c_fileid < kHFSFirstUserCatalogNodeID) &&
@@ -1021,31 +1012,21 @@ hfs_unlock(struct cnode *cp)
                        }
                }
        }
-       c_flag = cp->c_flag;
-       cp->c_flag &= ~(C_NEED_DVNODE_PUT | C_NEED_RVNODE_PUT | C_NEED_DATA_SETSIZE | C_NEED_RSRC_SETSIZE);
-       if (c_flag & (C_NEED_DVNODE_PUT | C_NEED_DATA_SETSIZE)) {
-               vp = cp->c_vp;
-       }
-       if (c_flag & (C_NEED_RVNODE_PUT | C_NEED_RSRC_SETSIZE)) {
-                rvp = cp->c_rsrc_vp;
-       }
+       if (cp->c_flag & C_NEED_DVNODE_PUT)
+               dvp = cp->c_vp;
+
+       if (cp->c_flag & C_NEED_RVNODE_PUT)
+               rvp = cp->c_rsrc_vp;
+
+       cp->c_flag &= ~(C_NEED_DVNODE_PUT | C_NEED_RVNODE_PUT);
 
-       cp->c_lockowner = NULL;
+       cp-> c_lockowner = NULL;
        lck_rw_done(&cp->c_rwlock);
 
-       /* Perform any vnode post processing after cnode lock is dropped. */
-       if (vp) {
-               if (c_flag & C_NEED_DATA_SETSIZE)
-                       ubc_setsize(vp, 0);
-               if (c_flag & C_NEED_DVNODE_PUT)
-                       vnode_put(vp);
-       }
-       if (rvp) {
-               if (c_flag & C_NEED_RSRC_SETSIZE)
-                       ubc_setsize(rvp, 0);
-               if (c_flag & C_NEED_RVNODE_PUT)
-                       vnode_put(rvp);
-       }
+       if (dvp)
+               vnode_put(dvp);
+       if (rvp)
+               vnode_put(rvp);
 }
 
 /*