]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_cnode.c
xnu-792.21.3.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_cnode.c
index 2e1ca961e1ecf750f003dd3a5c90655d1d7079f2..a3f321236c5595438965485854fb6570f0ffd65b 100644 (file)
@@ -1001,8 +1001,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) &&
@@ -1019,31 +1018,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_lockowner = NULL;
+       cp->c_flag &= ~(C_NEED_DVNODE_PUT | C_NEED_RVNODE_PUT);
+
+       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);
 }
 
 /*