Ejemplo n.º 1
0
void
doreclaim(struct puffs_node *pn)
{
	struct psshfs_node *psn = pn->pn_data;
	struct psshfs_node *psn_parent;
	struct psshfs_dir *dent;

	psn_parent = psn->parent->pn_data;
	psn_parent->childcount--;

	/*
	 * Null out entry from directory.  Do not treat a missing entry
	 * as an invariant error, since the node might be removed from
	 * under us, and we might do a readdir before the reclaim resulting
	 * in no directory entry in the parent directory.
	 */
	dent = lookup_by_entry(psn_parent->dir, psn_parent->dentnext, pn);
	if (dent)
		dent->entry = NULL;

	if (pn->pn_va.va_type == VDIR) {
		freedircache(psn->dir, psn->dentnext);
		psn->denttot = psn->dentnext = 0;
	}
	if (psn->symlink)
		free(psn->symlink);

	puffs_pn_put(pn);
}
Ejemplo n.º 2
0
void
perfuse_destroy_pn(struct puffs_usermount *pu, struct puffs_node *pn)
{
	struct perfuse_state *ps = puffs_getspecific(pu);
	struct perfuse_node_data *pnd;

	if ((pnd = puffs_pn_getpriv(pn)) != NULL) {
		if (pnd->pnd_all_fd != NULL)
			free(pnd->pnd_all_fd);

		if (pnd->pnd_dirent != NULL)
			free(pnd->pnd_dirent);
		
#ifdef PERFUSE_DEBUG
		if (pnd->pnd_flags & PND_OPEN)
			DERRX(EX_SOFTWARE, "%s: file open", __func__);

		if (!TAILQ_EMPTY(&pnd->pnd_pcq))
			DERRX(EX_SOFTWARE, "%s: non empty pnd_pcq", __func__);

		pnd->pnd_flags |= PND_INVALID;
#endif /* PERFUSE_DEBUG */

		free(pnd);
	}

	puffs_pn_put(pn);

	ps->ps_nodecount--;

	return;
}
Ejemplo n.º 3
0
/*ARGSUSED2*/
int
puffs_genfs_node_reclaim(struct puffs_usermount *pu, puffs_cookie_t opc)
{

	puffs_pn_put(PU_CMAP(pu, opc));

	return 0;
}
Ejemplo n.º 4
0
/*
 * - "here's one"
 * - "9P"
 * ~ "i'm not dead"
 * - "you're not fooling anyone you know, you'll be stone dead in a minute
 * - "he says he's not quite dead"
 * - "isn't there anything you could do?"
 * - *clunk*!
 * - "thanks"
 */
int
puffs9p_node_reclaim(struct puffs_usermount *pu, void *opc)
{
	struct puffs_node *pn = opc;
	struct p9pnode *p9n = pn->pn_data;

	assert(LIST_EMPTY(&p9n->dir_openlist));
	assert(p9n->fid_read == P9P_INVALFID && p9n->fid_write == P9P_INVALFID);

	proto_cc_clunkfid(pu, p9n->fid_base, 0);
	free(p9n);
	puffs_pn_put(pn);

	return 0;
}