diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-02-03 21:30:18 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-02-03 21:30:18 +0000 |
commit | f454914e59f827d70fc2ef03ae31e27810c5f59f (patch) | |
tree | a8bc65086020fb101ecdfc32b61d747ac71e848c /libdiskfs | |
parent | d172c6dff54ef35d43651db04aef866320886675 (diff) |
Formerly dir-link.c.~3~
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/dir-link.c | 18 |
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; } |