Lines Matching refs:cnode

59 static void  hfs_reclaim_cnode(struct cnode *);
61 static int hfs_isordered(struct cnode *, struct cnode *);
65 __inline__ int hfs_checkdeleted (struct cnode *cp) {
70 * Function used by a special fcntl() that decorates a cnode/vnode that
73 * the argument 'val' indicates whether or not to set the bit in the cnode flags
78 struct cnode *cp = NULL;
86 /* lock the cnode */
106 * Function used by a special fcntl() that check to see if a cnode/vnode
115 struct cnode *cp = NULL;
125 /* lock the cnode */
151 * necessary for the cnode in both places. Important tasks include things such as
155 * Note that we take only the vnode as an argument here (rather than the cnode).
156 * Recall that each cnode supports two forks (rsrc/data), and we can always get the right
157 * cnode from either of the vnodes, but the reverse is not true -- we can't determine which
158 * vnode we need to reclaim if only the cnode is supplied.
163 * As a quick check to see if this function is necessary, determine if the cnode is already
167 * in hfs_vnop_reclaim. hfs_update, by definition, is not necessary if the cnode's catalog
174 * Assumes that both truncate and cnode locks for 'cp' are held.
181 struct cnode *cp;
214 * Check whether we are tearing down a cnode with only one remaining fork.
215 * If there are blocks in its filefork, then we need to unlock the cnode
217 * (i.e. VNOP_BLOCKMAP), and if we retain the cnode lock, we could double-lock
260 * We're holding the cnode lock now. Stall behind any shadow BPs that may
330 * At this point, we have decided that this cnode is
454 * and the cnode has become open-unlinked,
471 * If the cnode represented an open-unlinked file, then now
472 * actually remove the cnode's catalog entry and release all blocks
477 * Mark cnode in transit so that no one can get this
478 * cnode from cnode hash.
481 // XXXdbg - remove the cnode from the hash table since it's deleted
482 // otherwise someone could go to sleep on the cnode and not
595 * cnode truncate lock and cnode lock are both held exclusive here.
597 * Go ahead and flush the keys out if this cnode is the last fork
633 * any remaining data still residing in the cnode. If necessary, write out
634 * remaining blocks or delete the cnode's entry in the catalog.
640 struct cnode *cp;
686 * If the cnode has already had its cat entry removed, then
702 * files' blocks from being in use, and move the cnode from C_DELETED to C_NOEXISTS.
707 * Drop the truncate lock before unlocking the cnode
731 struct cnode *cp;
832 * Reclaim a cnode so that it can be used for other purposes.
838 struct cnode *cp;
858 * Sync to disk any remaining data in the cnode/vnode. This includes
859 * a call to hfs_update if the cnode has outbound data.
861 * If C_NOEXISTS is set on the cnode, then there's nothing teardown needs to do
862 * because the catalog entry for this cnode is already gone.
895 panic("hfs_vnop_reclaim: vp points to wrong cnode (vp=%p cp->c_vp=%p cp->c_rsrc_vp=%p)\n", vp, cp->c_vp, cp->c_rsrc_vp);
898 * On the last fork, remove the cnode from its hash chain.
901 /* If we can't remove it then the cnode must persist! */
925 * If there was only one active fork then we can release the cnode.
933 * cnode in use. If it is a directory, it could have
954 * The vnode is returned with an iocount and the cnode locked
972 struct cnode *cp = NULL;
1014 * The only case were its permissible to hold the parent cnode
1016 * we don't need the cnode lock (GNV_SKIPLOCK).
1021 panic("hfs_getnewvnode: unexpected hold of parent cnode %p", VTOC(dvp));
1026 * Get a cnode (new or existing)
1039 * If we get a cnode/vnode pair out of hfs_chash_getcnode, then update the
1040 * descriptor in the cnode as needed if the cnode represents a hardlink.
1043 * If there isn't a vnode, then the cnode is brand new and needs to be initialized
1057 /* If cnode is uninitialized, its c_attr will be zeroed out; cnids wont match. */
1064 * the cnode lock again.
1083 * the hash code peeks at those fields without holding the cnode lock because
1086 * wake up all waiters for this cnode.
1114 * If this is a new cnode then initialize it.
1132 * that we checked the catalog and the time we went to get a vnode/cnode for it,
1204 /* Mark the output flag that we're vending a new cnode */
1252 * but the cnode already has the data fork)
1256 * try to take the cnode lock in hfs_vnop_fsync or
1258 * because we already hold the cnode lock which will
1268 * after we've dropped the cnode lock
1335 * If this is a newly created cnode or a vnode reclaim
1336 * occurred during the attachment, then cleanup the cnode.
1393 hfs_reclaim_cnode(struct cnode *cp)
1421 * attempting to reclaim a cnode with only one live fork. Because the vnode
1441 bzero(cp, sizeof(struct cnode));
1442 FREE_ZONE(cp, sizeof(struct cnode), M_HFSNODE);
1510 * race. Specifically, if there is no vnode/cnode pair for the directory entry
1522 * with the cnode hash. In this case, if we don't check/validate the cat_attr in-hand, we will
1523 * blindly stuff it into the cnode, which will make the in-core data inconsistent with what is
1524 * on disk. So validate the cat_attr below, if required. This race cannot happen if the cnode/vnode
1608 u_int32_t hfs_get_dateadded (struct cnode *cp) {
1639 * Touch cnode times based on c_touch_xxx flags
1641 * cnode must be locked exclusive
1646 hfs_touchtimes(struct hfsmount *hfsmp, struct cnode* cp)
1667 * . the vnode associated with this cnode is marked for rapid aging
1736 * Lock a cnode.
1739 hfs_lock(struct cnode *cp, enum hfslocktype locktype)
1790 printf("hfs_lock: bad lock order (cnode after journal)\n");
1793 panic("hfs_lock: bad lock order (cnode after catalog)");
1796 panic("hfs_lock: bad lock order (cnode after attribute)");
1799 panic("hfs_lock: bad lock order (cnode after extents)");
1821 hfs_lockpair(struct cnode *cp1, struct cnode *cp2, enum hfslocktype locktype)
1823 struct cnode *first, *last;
1834 * Lock in cnode address order.
1858 hfs_isordered(struct cnode *cp1, struct cnode *cp2)
1862 if (cp1 == NULL || cp2 == (struct cnode *)0xffffffff)
1864 if (cp2 == NULL || cp1 == (struct cnode *)0xffffffff)
1867 * Locking order is cnode address order.
1873 * Acquire 4 cnode locks.
1874 * - locked in cnode address order (lesser address first).
1876 * - only one lock taken per cnode (dup cnodes are skipped)
1877 * - some of the cnode pointers may be null
1880 hfs_lockfour(struct cnode *cp1, struct cnode *cp2, struct cnode *cp3,
1881 struct cnode *cp4, enum hfslocktype locktype, struct cnode **error_cnode)
1883 struct cnode * a[3];
1884 struct cnode * b[3];
1885 struct cnode * list[4];
1886 struct cnode * tmp;
1903 a[2] = (struct cnode *)0xffffffff; /* sentinel value */
1904 b[2] = (struct cnode *)0xffffffff; /* sentinel value */
1939 * Unlock a cnode.
1942 hfs_unlock(struct cnode *cp)
1976 /* Perform any vnode post processing after cnode lock is dropped. */
1995 hfs_unlockpair(struct cnode *cp1, struct cnode *cp2)
2006 hfs_unlockfour(struct cnode *cp1, struct cnode *cp2, struct cnode *cp3, struct cnode *cp4)
2008 struct cnode * list[4];
2044 * Protect a cnode against a truncation.
2047 * cnode lock across calls to the cluster layer.
2055 hfs_lock_truncate(struct cnode *cp, enum hfslocktype locktype)
2071 panic("hfs_lock_truncate: cnode %p locked!", cp);
2092 int hfs_try_trunclock (struct cnode *cp, enum hfslocktype locktype) {
2108 panic("hfs_lock_truncate: cnode %p locked!", cp);
2136 hfs_unlock_truncate(struct cnode *cp, int been_recursed)