summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-link.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-03 21:30:18 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-03 21:30:18 +0000
commitf454914e59f827d70fc2ef03ae31e27810c5f59f (patch)
treea8bc65086020fb101ecdfc32b61d747ac71e848c /libdiskfs/dir-link.c
parentd172c6dff54ef35d43651db04aef866320886675 (diff)
Formerly dir-link.c.~3~
Diffstat (limited to 'libdiskfs/dir-link.c')
-rw-r--r--libdiskfs/dir-link.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libdiskfs/dir-link.c b/libdiskfs/dir-link.c
index 604849f0..a7edad6e 100644
--- a/libdiskfs/dir-link.c
+++ b/libdiskfs/dir-link.c
@@ -33,7 +33,7 @@ diskfs_S_dir_link (struct protid *filecred,
return EOPNOTSUPP;
np = filecred->po->np;
- if (readonly)
+ if (diskfs_readonly)
return EROFS;
if (!dircred)
@@ -46,11 +46,15 @@ diskfs_S_dir_link (struct protid *filecred,
mutex_lock (&np->lock);
if (S_ISDIR (np->dn_stat.st_mode))
- error = EISDIR;
- else if (np->dn_stat.st_nlink == LINK_MAX - 1)
- error = EMLINK;
- if (error)
- goto out;
+ {
+ error = EISDIR;
+ goto out;
+ }
+ else if (np->dn_stat.st_nlink == diskfs_link_max - 1)
+ {
+ error = EMLINK;
+ goto out;
+ }
error = diskfs_lookup (dnp, name, CREATE, 0, ds, dircred);
@@ -60,7 +64,7 @@ diskfs_S_dir_link (struct protid *filecred,
error = EEXIST;
if (error != ENOENT)
{
- diskfs_drop_dirstat (ds);
+ diskfs_drop_dirstat (dnp, ds);
goto out;
}