From d9c156d1846813eb849b4678244408da1e84e412 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 4 Feb 1994 21:35:23 +0000 Subject: Formerly dir-clear.c.~3~ --- libdiskfs/dir-clear.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/dir-clear.c b/libdiskfs/dir-clear.c index e42cd04e..73cada6a 100644 --- a/libdiskfs/dir-clear.c +++ b/libdiskfs/dir-clear.c @@ -17,6 +17,9 @@ #include "priv.h" +/* Clear the `.' and `..' entries from directory DP. Its parent is PDP, + and the user responsible for this is identified by CRED. Both + directories must be locked. */ error_t diskfs_clear_directory (struct node *dp, struct node *pdp, @@ -31,7 +34,7 @@ diskfs_clear_directory (struct node *dp, if (!err) err = diskfs_dirremove (dp, ds); else - diskfs_drop_dirstat (ds); + diskfs_drop_dirstat (dp, ds); if (err) return err; @@ -40,14 +43,14 @@ diskfs_clear_directory (struct node *dp, dp->dn_set_ctime = 1; /* Find and remove the `..' entry. */ - err = ufs_checkdirmod (dp, dp->dn_stat.st_mode, pdp, cred); + err = diskfs_checkdirmod (dp, pdp, cred); if (!err) err = diskfs_lookup (dp, "..", REMOVE | SPEC_DOTDOT, 0, ds, cred); assert (err != ENOENT); if (!err) err = diskfs_dirremove (dp, ds); else - diskfs_drop_dirstat (ds); + diskfs_drop_dirstat (dp, ds); if (err) return err; -- cgit v1.2.3