From 0dd4115e8e146d9f887c20ddbf345b7a3ba8d9b8 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 25 Oct 1994 19:35:24 +0000 Subject: Formerly dir.c.~8~ --- ufs-fsck/dir.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) -- cgit v1.2.3