diff options
-rw-r--r-- | libdiskfs/dir-link.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libdiskfs/dir-link.c b/libdiskfs/dir-link.c index 7f1ab2f5..7cc88633 100644 --- a/libdiskfs/dir-link.c +++ b/libdiskfs/dir-link.c @@ -1,5 +1,5 @@ /* libdiskfs implementation of fs.defs: dir_link - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation + Copyright (C) 1992,93,94,95,96,97,99 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -31,16 +31,16 @@ diskfs_S_dir_link (struct protid *dircred, struct dirstat *ds = alloca (diskfs_dirstat_size); error_t error; - if (!filecred) + if (!dircred) return EOPNOTSUPP; - - np = filecred->po->np; + if (diskfs_check_readonly ()) return EROFS; - - if (!dircred) + + if (!filecred) return EXDEV; - + + np = filecred->po->np; mutex_lock (&np->lock); if (S_ISDIR (np->dn_stat.st_mode)) { @@ -48,7 +48,7 @@ diskfs_S_dir_link (struct protid *dircred, return EISDIR; } mutex_unlock (&np->lock); - + dnp = dircred->po->np; mutex_lock (&dnp->lock); @@ -76,7 +76,7 @@ diskfs_S_dir_link (struct protid *dircred, mach_port_deallocate (mach_task_self (), filecred->pi.port_right); return 0; } - + if (tnp && S_ISDIR (tnp->dn_stat.st_mode)) { diskfs_drop_dirstat (dnp, ds); @@ -84,13 +84,13 @@ diskfs_S_dir_link (struct protid *dircred, mutex_unlock (&tnp->lock); return EISDIR; } - + /* Create new entry for NP */ /* This is safe because NP is not a directory (thus not DNP) and not TNP and is a leaf. */ mutex_lock (&np->lock); - + /* Increment link count */ if (np->dn_stat.st_nlink == diskfs_link_max - 1) { @@ -102,7 +102,7 @@ diskfs_S_dir_link (struct protid *dircred, np->dn_stat.st_nlink++; np->dn_set_ctime = 1; diskfs_node_update (np, 1); - + /* Attach it */ if (tnp) { @@ -120,10 +120,10 @@ diskfs_S_dir_link (struct protid *dircred, } else error = diskfs_direnter (dnp, name, np, ds, dircred); - + if (diskfs_synchronous) diskfs_node_update (dnp, 1); - + mutex_unlock (&dnp->lock); mutex_unlock (&np->lock); if (!error) |