summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-04 21:35:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-04 21:35:23 +0000
commitd9c156d1846813eb849b4678244408da1e84e412 (patch)
tree0fc8a129e12f42474c4e0a6268c80d03f0c6b319 /libdiskfs
parent3fd7d7d1196d723a86e44ac4fc00f4b54abcd5c3 (diff)
Formerly dir-clear.c.~3~
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-clear.c9
1 files changed, 6 insertions, 3 deletions
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;