Nodes cannot use the '0' identifier or they will be skipped by readdir.

E.g., the root node's '.' and '..' directory entries did not appear in
a directory list, because the root node always holds the first id.
This commit is contained in:
jmmv 2005-09-13 21:30:52 +00:00
parent 0743a9e845
commit 2ddaf8b92b
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: t_readdir,v 1.1 2005/09/10 19:20:51 jmmv Exp $
# $NetBSD: t_readdir,v 1.2 2005/09/13 21:30:52 jmmv Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@ -44,6 +44,10 @@
test_run() {
test_mount
test_name "Directory has '.' and '..' entries"
/bin/ls -a | grep '^\.$' >/dev/null || die
/bin/ls -a | grep '^\..$' >/dev/null || die
test_name "Creation of files of all possible types"
mkdir dir || die
touch reg || die

View File

@ -1,4 +1,4 @@
/* $NetBSD: tmpfs_vfsops.c,v 1.2 2005/09/10 22:28:57 jmmv Exp $ */
/* $NetBSD: tmpfs_vfsops.c,v 1.3 2005/09/13 21:30:52 jmmv Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.2 2005/09/10 22:28:57 jmmv Exp $");
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.3 2005/09/13 21:30:52 jmmv Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -163,7 +163,7 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
KASSERT(tmp != NULL);
tmp->tm_nodes_max = nodes;
tmp->tm_nodes_last = 0;
tmp->tm_nodes_last = 1;
LIST_INIT(&tmp->tm_nodes_used);
LIST_INIT(&tmp->tm_nodes_avail);