Call puffs_pn_remove() just in case the file server happens to be

quick with recycling qids.
This commit is contained in:
pooka 2007-06-24 19:13:39 +00:00
parent 5568917ed8
commit 91629617de
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: node.c,v 1.12 2007/05/19 10:38:23 pooka Exp $ */ /* $NetBSD: node.c,v 1.13 2007/06/24 19:13:39 pooka Exp $ */
/* /*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved. * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: node.c,v 1.12 2007/05/19 10:38:23 pooka Exp $"); __RCSID("$NetBSD: node.c,v 1.13 2007/06/24 19:13:39 pooka Exp $");
#endif /* !lint */ #endif /* !lint */
#include <assert.h> #include <assert.h>
@ -460,9 +460,10 @@ puffs9p_node_mkdir(struct puffs_cc *pcc, void *opc, void **newnode,
* ice with. * ice with.
*/ */
static int static int
noderemove(struct puffs_cc *pcc, struct p9pnode *p9n) noderemove(struct puffs_cc *pcc, struct puffs_node *pn)
{ {
AUTOVAR(pcc); AUTOVAR(pcc);
struct p9pnode *p9n = pn->pn_data;
p9pfid_t testfid = NEXTFID(p9p); p9pfid_t testfid = NEXTFID(p9p);
rv = proto_cc_dupfid(pcc, p9n->fid_base, testfid); rv = proto_cc_dupfid(pcc, p9n->fid_base, testfid);
@ -484,6 +485,7 @@ noderemove(struct puffs_cc *pcc, struct p9pnode *p9n)
} else { } else {
proto_cc_clunkfid(pcc, p9n->fid_base, 0); proto_cc_clunkfid(pcc, p9n->fid_base, 0);
p9n->fid_base = P9P_INVALFID; p9n->fid_base = P9P_INVALFID;
puffs_pn_remove(pn);
} }
out: out:
@ -502,7 +504,7 @@ puffs9p_node_remove(struct puffs_cc *pcc, void *opc, void *targ,
if (pn->pn_va.va_type == VDIR) if (pn->pn_va.va_type == VDIR)
return EISDIR; return EISDIR;
return noderemove(pcc, pn->pn_data); return noderemove(pcc, pn);
} }
int int
@ -514,7 +516,7 @@ puffs9p_node_rmdir(struct puffs_cc *pcc, void *opc, void *targ,
if (pn->pn_va.va_type != VDIR) if (pn->pn_va.va_type != VDIR)
return ENOTDIR; return ENOTDIR;
return noderemove(pcc, pn->pn_data); return noderemove(pcc, pn);
} }
/* /*