afs_int32 freePtr; /* first free index in this table */
Inode inode[MAXATONCE]; /* inode # */
afs_int32 count[MAXATONCE]; /* link count */
-} *allInodes = 0;
+};
/* called with a structure specifying info about the inode, and our rock (which
* is the volume ID. Returns true if we should keep this inode, otherwise false.
* Note that ainfo->u.param[0] is always the volume ID, for any vice inode.
*/
static int
-NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid)
+NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist *allInodes)
{
struct ilist *ti;
register afs_int32 i;
{
/* first process the partition containing this junk */
struct afs_stat tstat;
- struct ilist *ti, *ni;
+ struct ilist *ti, *ni, *li=NULL;
register afs_int32 code;
int i, forceSal;
char devName[64], wpath[100];
#endif
#endif /* AFS_NAMEI_ENV */
IHandle_t *fileH;
+ struct ilist *allInodes = 0;
if (avolid == 0)
return EINVAL;
#ifdef AFS_NAMEI_ENV
code =
ListViceInodes(lastDevComp, aname, NULL, NukeProc, avolid, &forceSal,
- 0, wpath);
+ 0, wpath, allInodes);
#else
code =
ListViceInodes(lastDevComp, aname, "/tmp/vNukeXX", NukeProc, avolid,
- &forceSal, 0, wpath);
+ &forceSal, 0, wpath, allInodes);
unlink("/tmp/vNukeXX"); /* clean it up now */
#endif
if (code == 0) {
#endif /* AFS_NAMEI_ENV */
}
ni = ti->next;
- free(ti);
+ if (li) free(li);
+ li = ti;
}
+ if (li) free(li);
code = 0; /* we really don't care about it except for debugging */
allInodes = NULL;
/* just free things */
for (ti = allInodes; ti; ti = ni) {
ni = ti->next;
- free(ti);
+ if (li) free(li);
+ li = ti;
}
+ if (li) free(li);
allInodes = NULL;
}
ReleaseWriteLock(&localLock);