summaryrefslogtreecommitdiff
path: root/isofs
diff options
context:
space:
mode:
Diffstat (limited to 'isofs')
-rw-r--r--isofs/Makefile3
-rw-r--r--isofs/inode.c30
-rw-r--r--isofs/lookup.c4
-rw-r--r--isofs/main.c4
-rw-r--r--isofs/pager.c20
5 files changed, 31 insertions, 30 deletions
diff --git a/isofs/Makefile b/isofs/Makefile
index 4f788368..053b622e 100644
--- a/isofs/Makefile
+++ b/isofs/Makefile
@@ -21,7 +21,8 @@ target = iso9660fs
SRCS = inode.c main.c lookup.c pager.c rr.c
OBJS = $(SRCS:.c=.o)
-HURDLIBS = diskfs iohelp fshelp store pager threads ports ihash shouldbeinlibc
+HURDLIBS = diskfs iohelp fshelp store pager ports ihash shouldbeinlibc
+OTHERLIBS = -lpthread
include ../Makeconf
diff --git a/isofs/inode.c b/isofs/inode.c
index 99aca957..d848908b 100644
--- a/isofs/inode.c
+++ b/isofs/inode.c
@@ -71,8 +71,8 @@ inode_cache_find (off_t id, struct node **npp)
{
*npp = node_cache[i].np;
(*npp)->references++;
- spin_unlock (&diskfs_node_refcnt_lock);
- mutex_lock (&(*npp)->lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_mutex_lock (&(*npp)->lock);
return;
}
*npp = 0;
@@ -154,7 +154,7 @@ diskfs_cached_lookup (ino_t id, struct node **npp)
to avoid presenting zero cache ID's. */
id--;
- spin_lock (&diskfs_node_refcnt_lock);
+ pthread_spin_lock (&diskfs_node_refcnt_lock);
assert (id < node_cache_size);
np = node_cache[id].np;
@@ -173,7 +173,7 @@ diskfs_cached_lookup (ino_t id, struct node **npp)
dn = malloc (sizeof (struct disknode));
if (!dn)
{
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
release_rrip (&rr);
return ENOMEM;
}
@@ -184,14 +184,14 @@ diskfs_cached_lookup (ino_t id, struct node **npp)
if (!np)
{
free (dn);
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
release_rrip (&rr);
return ENOMEM;
}
np->cache_id = id + 1; /* see above for rationale for increment */
- mutex_lock (&np->lock);
+ pthread_mutex_lock (&np->lock);
c->np = np;
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
err = read_disknode (np, node_cache[id].dr, &rr);
if (!err)
@@ -204,8 +204,8 @@ diskfs_cached_lookup (ino_t id, struct node **npp)
np->references++;
- spin_unlock (&diskfs_node_refcnt_lock);
- mutex_lock (&np->lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_mutex_lock (&np->lock);
*npp = np;
return 0;
}
@@ -314,7 +314,7 @@ load_inode (struct node **npp, struct dirrect *record,
if (rr->valid & VALID_CL)
record = rr->realdirent;
- spin_lock (&diskfs_node_refcnt_lock);
+ pthread_spin_lock (&diskfs_node_refcnt_lock);
/* First check the cache */
if (use_file_start_id (record, rr))
@@ -324,7 +324,7 @@ load_inode (struct node **npp, struct dirrect *record,
if (*npp)
{
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
return 0;
}
@@ -332,7 +332,7 @@ load_inode (struct node **npp, struct dirrect *record,
dn = malloc (sizeof (struct disknode));
if (!dn)
{
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
return ENOMEM;
}
dn->fileinfo = 0;
@@ -343,14 +343,14 @@ load_inode (struct node **npp, struct dirrect *record,
if (!np)
{
free (dn);
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
return ENOMEM;
}
- mutex_lock (&np->lock);
+ pthread_mutex_lock (&np->lock);
cache_inode (np, record, rr);
- spin_unlock (&diskfs_node_refcnt_lock);
+ pthread_spin_unlock (&diskfs_node_refcnt_lock);
err = read_disknode (np, record, rr);
*npp = np;
diff --git a/isofs/lookup.c b/isofs/lookup.c
index 8daa5464..2ff30496 100644
--- a/isofs/lookup.c
+++ b/isofs/lookup.c
@@ -132,9 +132,9 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type,
/* We don't have to do the normal rigamarole, because
we are permanently read-only, so things are necessarily
quiescent. Just be careful to honor the locking order. */
- mutex_unlock (&dp->lock);
+ pthread_mutex_unlock (&dp->lock);
err = load_inode (npp, record, &rr);
- mutex_lock (&dp->lock);
+ pthread_mutex_lock (&dp->lock);
}
}
else if (namelen == 1 && name[0] == '.')
diff --git a/isofs/main.c b/isofs/main.c
index 4f6ea8fa..5d002aff 100644
--- a/isofs/main.c
+++ b/isofs/main.c
@@ -60,7 +60,7 @@ fetch_root ()
err = load_inode (&diskfs_root_node, dr, &rl);
assert_perror (err);
- mutex_unlock (&diskfs_root_node->lock);
+ pthread_mutex_unlock (&diskfs_root_node->lock);
}
@@ -144,7 +144,7 @@ main (int argc, char **argv)
diskfs_startup_diskfs (bootstrap, 0);
- cthread_exit (0);
+ pthread_exit (NULL);
return 0;
}
diff --git a/isofs/pager.c b/isofs/pager.c
index 5142cbc8..f93e0c82 100644
--- a/isofs/pager.c
+++ b/isofs/pager.c
@@ -22,7 +22,7 @@
#include <string.h>
#include "isofs.h"
-spin_lock_t node2pagelock = SPIN_LOCK_INITIALIZER;
+pthread_spinlock_t node2pagelock = PTHREAD_SPINLOCK_INITIALIZER;
struct port_bucket *pager_bucket;
@@ -111,10 +111,10 @@ pager_clear_user_data (struct user_pager_info *upi)
{
if (upi->type == FILE_DATA)
{
- spin_lock (&node2pagelock);
+ pthread_spin_lock (&node2pagelock);
if (upi->np->dn->fileinfo == upi)
upi->np->dn->fileinfo = 0;
- spin_unlock (&node2pagelock);
+ pthread_spin_unlock (&node2pagelock);
diskfs_nrele_light (upi->np);
}
free (upi);
@@ -159,7 +159,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
|| S_ISREG (np->dn_stat.st_mode)
|| S_ISLNK (np->dn_stat.st_mode));
- spin_lock (&node2pagelock);
+ pthread_spin_lock (&node2pagelock);
do
if (!np->dn->fileinfo)
@@ -173,7 +173,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
{
diskfs_nrele_light (np);
free (upi);
- spin_unlock (&node2pagelock);
+ pthread_spin_unlock (&node2pagelock);
return MACH_PORT_NULL;
}
np->dn->fileinfo = upi;
@@ -192,7 +192,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
}
while (right == MACH_PORT_NULL);
- spin_unlock (&node2pagelock);
+ pthread_spin_unlock (&node2pagelock);
mach_port_insert_right (mach_task_self (), right, right,
MACH_MSG_TYPE_MAKE_SEND);
@@ -207,11 +207,11 @@ drop_pager_softrefs (struct node *np)
{
struct user_pager_info *upi;
- spin_lock (&node2pagelock);
+ pthread_spin_lock (&node2pagelock);
upi = np->dn->fileinfo;
if (upi)
ports_port_ref (upi->p);
- spin_unlock (&node2pagelock);
+ pthread_spin_unlock (&node2pagelock);
if (upi)
{
@@ -227,11 +227,11 @@ allow_pager_softrefs (struct node *np)
{
struct user_pager_info *upi;
- spin_lock (&node2pagelock);
+ pthread_spin_lock (&node2pagelock);
upi = np->dn->fileinfo;
if (upi)
ports_port_ref (upi->p);
- spin_unlock (&node2pagelock);
+ pthread_spin_unlock (&node2pagelock);
if (upi)
{