summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-25 19:35:24 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-25 19:35:24 +0000
commit0dd4115e8e146d9f887c20ddbf345b7a3ba8d9b8 (patch)
tree21615801907d10d1ddd784ab73112a0760223b01
parent823bc11ec71d8d24efac26a4d38abe33673e4e5e (diff)
Formerly dir.c.~8~
-rw-r--r--ufs-fsck/dir.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ufs-fsck/dir.c b/ufs-fsck/dir.c
index c8ad46ed..f99a290d 100644
--- a/ufs-fsck/dir.c
+++ b/ufs-fsck/dir.c
@@ -63,6 +63,19 @@ record_directory (struct dinode *dp, ino_t number)
dirarrayused++;
}
+/* Return the cached dirinfo structure for directory INO. */
+struct dirinfo *
+lookup_directory (ino_t ino)
+{
+ int i;
+
+ for (i = 0; i < dirarrayused; i++)
+ if (dirarray[i]->i_number == ino)
+ return dirarray[i];
+
+ errexit ("Cannot find chached directory I=%d\n", ino);
+}
+
/* Check to see if DIR is really a readable directory; if it
isn't, then bail with an appropriate message and return 0;
else return 1. MSG identifies the action contemplated */
@@ -386,6 +399,8 @@ ino_t
allocdir (ino_t parent, ino_t request, mode_t mode)
{
ino_t ino;
+
+ mode |= IFDIR;
ino = allocino (request, mode);
if (!ino)