Use SETBACK_NOREF instead of SETBACK_INACT to control node removal.

Avoids one round of inactive (wheee!).
This commit is contained in:
pooka 2007-05-18 15:53:07 +00:00
parent e99cb62bcc
commit 1d9d9332f5
2 changed files with 5 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs.c,v 1.25 2007/05/18 13:55:21 pooka Exp $ */
/* $NetBSD: dtfs.c,v 1.26 2007/05/18 15:53:07 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -192,7 +192,6 @@ main(int argc, char *argv[])
PUFFSOP_SET(pops, dtfs, node, symlink);
PUFFSOP_SET(pops, dtfs, node, readlink);
PUFFSOP_SET(pops, dtfs, node, mknod);
PUFFSOP_SET(pops, dtfs, node, inactive);
PUFFSOP_SET(pops, dtfs, node, reclaim);
srandom(time(NULL)); /* for random generation numbers */

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs_vnops.c,v 1.26 2007/05/18 13:55:21 pooka Exp $ */
/* $NetBSD: dtfs_vnops.c,v 1.27 2007/05/18 15:53:07 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -192,8 +192,8 @@ dtfs_node_remove(struct puffs_cc *pcc, void *opc, void *targ,
dtfs_nukenode(targ, pn_parent, pcn->pcn_name);
/* call inactive for removed node when its time comes */
puffs_setback(pcc, PUFFS_SETBACK_INACT_N2);
if (pn->pn_va.va_nlink == 0)
puffs_setback(pcc, PUFFS_SETBACK_NOREF_N2);
return 0;
}
@ -224,6 +224,7 @@ dtfs_node_rmdir(struct puffs_cc *pcc, void *opc, void *targ,
return ENOTEMPTY;
dtfs_nukenode(targ, pn_parent, pcn->pcn_name);
puffs_setback(pcc, PUFFS_SETBACK_NOREF_N2);
return 0;
}
@ -497,14 +498,3 @@ dtfs_node_reclaim(struct puffs_cc *pcc, void *opc, pid_t pid)
return 0;
}
int
dtfs_node_inactive(struct puffs_cc *pcc, void *opc, pid_t pid,
int *refcount)
{
struct puffs_node *pn = opc;
*refcount = pn->pn_va.va_nlink;
return 0;
}