hurdextras-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

httpfs netfs.c


From: Samuel Thibault
Subject: httpfs netfs.c
Date: Fri, 25 Jan 2013 00:36:50 +0000

CVSROOT:        /cvsroot/hurdextras
Module name:    httpfs
Changes by:     Samuel Thibault <sthibaul>      13/01/25 00:36:50

Modified files:
        .              : netfs.c 

Log message:
        Switch from cthreads to  pthreads
        
        * netfs.c: Call pthread_mutex_lock and pthread_mutex_unlock instead of
        mutex_lock and mutex_unlock

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/httpfs/netfs.c?cvsroot=hurdextras&r1=1.2&r2=1.3

Patches:
Index: netfs.c
===================================================================
RCS file: /cvsroot/hurdextras/httpfs/netfs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- netfs.c     14 Jan 2013 10:47:05 -0000      1.2
+++ netfs.c     25 Jan 2013 00:36:50 -0000      1.3
@@ -43,7 +43,7 @@
                                                                                
                         char *name, mode_t mode, struct node **node)
 {
        *node = NULL;
-       mutex_unlock (&dir->lock);
+       pthread_mutex_unlock (&dir->lock);
        return EROFS;
 }
 
@@ -164,15 +164,15 @@
                err = ENOTDIR;
                return err;
        }
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
        if (!dir->nn->ents && !dir->nn->noents) {
-               mutex_lock (&dir->lock);
+               pthread_mutex_lock (&dir->lock);
                err = fill_dirnode (dir->nn);
                if (err) {
                        fprintf(stderr,"Error with fill dir node\n");
                        return err;
                }
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
        }
 
        for (nd = dir->nn->ents; first_entry > 0 && nd; first_entry--, 
nd=nd->next) 
@@ -266,39 +266,39 @@
 
        if (!dir ) {
                err = ENOTDIR;
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
                return err;
        }
        if (dir->nn->type == HTTP_URL || dir->nn->type == HTTP_FILE) {
                err = ENOTDIR;
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
                return err;
        }
        /* no matter what unlock it */
-       mutex_unlock (&dir->lock);
+       pthread_mutex_unlock (&dir->lock);
 
        if ( *name=='\0' || strcmp(name,".")==0 ) {
                *node = dir;
-               mutex_lock(&dir->lock);
+               pthread_mutex_lock(&dir->lock);
                netfs_nref(dir);
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
                return 0;
        }
        else if ( strcmp(name,"..") == 0 ) {
                *node = dir;
-               mutex_lock(&dir->lock);
+               pthread_mutex_lock(&dir->lock);
                netfs_nref(*node);
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
                return 0;
        }
                
        for (nd = dir->nn->ents; nd && strcmp (name, nd->nn->file_name); nd = 
nd->next)
                ;
        if (nd) {
-               mutex_lock (&dir->lock);
+               pthread_mutex_lock (&dir->lock);
                *node = nd;
                netfs_nref(*node);
-               mutex_unlock (&dir->lock);
+               pthread_mutex_unlock (&dir->lock);
                err = 0;
        } else  {
                err = ENOENT;
@@ -445,7 +445,7 @@
                                                                                
                                        mode_t mode, struct node ** node)
 {
        *node = NULL;
-       mutex_unlock (&dir->lock);
+       pthread_mutex_unlock (&dir->lock);
        return EROFS;
 }
 
@@ -521,7 +521,7 @@
    all its associated storage. */
 void netfs_node_norefs (struct node *np)
 {
-       mutex_lock (&np->lock);
+       pthread_mutex_lock (&np->lock);
        *np->prevp = np->next;
        np->next->prevp = np->prevp;
        free_node (np);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]