summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-06 08:35:12 +0000
committerMiles Bader <miles@gnu.org>1997-02-06 08:35:12 +0000
commitb8125e04cfab0ed8f92a50f6a8f241dc6389b511 (patch)
tree75f26f19d7cc009dc890cc4fc3c83b2f8a30f35e /libdiskfs
parentee780c43a31df046cf9ec469b6a1266e6d1e1a39 (diff)
(diskfs_S_dir_rename):
Supply DEPTH & NEW_DEPTH arguments to diskfs_lookup. Translate EAGAIN (meaning root's parent) to EINVAL.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-rename.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c
index 7e993def..5c15a1cc 100644
--- a/libdiskfs/dir-rename.c
+++ b/libdiskfs/dir-rename.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs: dir_rename
- Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -53,8 +53,11 @@ diskfs_S_dir_rename (struct protid *fromcred,
will prevent anyone from deleting it before we create
the new link. */
mutex_lock (&fdp->lock);
- err = diskfs_lookup (fdp, fromname, LOOKUP, &fnp, 0, fromcred);
+ err = diskfs_lookup (fdp, fromname, LOOKUP, &fnp, 0, fromcred,
+ fromcred->po->depth, 0);
mutex_unlock (&fdp->lock);
+ if (err == EAGAIN)
+ err = EINVAL;
if (err)
return err;
@@ -99,8 +102,11 @@ diskfs_S_dir_rename (struct protid *fromcred,
/* Link the node into the new directory. */
mutex_lock (&tdp->lock);
- err = diskfs_lookup (tdp, toname, RENAME, &tnp, ds, tocred);
- if (!err && excl)
+ err = diskfs_lookup (tdp, toname, RENAME, &tnp, ds, tocred,
+ tocred->po->depth, 0);
+ if (err == EAGAIN)
+ err = EINVAL;
+ else if (!err && excl)
{
err = EEXIST;
diskfs_nput (tnp);
@@ -180,7 +186,8 @@ diskfs_S_dir_rename (struct protid *fromcred,
fdp locked (nor could we), so someone else might have already
removed it. */
mutex_lock (&fdp->lock);
- err = diskfs_lookup (fdp, fromname, REMOVE, &tmpnp, ds, fromcred);
+ err = diskfs_lookup (fdp, fromname, REMOVE, &tmpnp, ds, fromcred,
+ fromcred->po->depth, 0);
if (err)
{
diskfs_drop_dirstat (tdp, ds);