From f454914e59f827d70fc2ef03ae31e27810c5f59f Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 3 Feb 1994 21:30:18 +0000 Subject: Formerly dir-link.c.~3~ --- libdiskfs/dir-link.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'libdiskfs') 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; } -- cgit v1.2.3