--------------------- PatchSet 1383 Date: 2001/01/25 16:06:34 Author: darius Branch: sfs Tag: (none) Log: various comment tweaks, and removed orphan request support Members: src/fs/sfs/sfs_defines.h:1.1.2.3->1.1.2.4 src/fs/sfs/sfs_util.c:1.1.2.4->1.1.2.5 Index: squid/src/fs/sfs/sfs_defines.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/sfs_defines.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/src/fs/sfs/sfs_defines.h 25 Jan 2001 12:10:45 -0000 1.1.2.3 +++ squid/src/fs/sfs/sfs_defines.h 25 Jan 2001 16:06:34 -0000 1.1.2.4 @@ -1,4 +1,4 @@ -/* $Id: sfs_defines.h,v 1.1.2.3 2001/01/25 12:10:45 adri Exp $ */ +/* $Id: sfs_defines.h,v 1.1.2.4 2001/01/25 16:06:34 darius Exp $ */ #ifndef SFS_DEFINES_H #define SFS_DEFINES_H @@ -77,7 +77,6 @@ enum sfs_request_state request_state; pthread_cond_t done_signal; pthread_mutex_t done_signal_lock; - int orphan; /* Set this, and the thread will clean this requestor up */ sfsid_t sfsid; sfsfd_t sfsfd; sfsblock_t sfsinode; Index: squid/src/fs/sfs/sfs_util.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/sfs_util.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/src/fs/sfs/sfs_util.c 25 Jan 2001 12:10:45 -0000 1.1.2.4 +++ squid/src/fs/sfs/sfs_util.c 25 Jan 2001 16:06:34 -0000 1.1.2.5 @@ -26,11 +26,6 @@ /* This doesn't free the buffer - not sure whether we have any need to keep the buffer anywhere or not, but the option is there... */ { - /* - * We used to make sure that the request was actually *ON* the - * given list. This may be a good thing, but I've ripped it out - * for the time being. - */ printf("DEBUG: Removing %d request from queue\n",req->request_type); pthread_mutex_lock(&(_sfs_mounted[req->sfsid].req_lock)); dlinkDelete(&req->node, list); @@ -39,18 +34,15 @@ return (0); } + void _sfs_done_request(sfs_requestor *req, int retval) { - printf ("DEBUG: _sfs_done_request %d\n",req->request_type); - if (req->orphan) { - _sfs_remove_request(&_sfs_mounted[req->sfsid].request_queue,req); - } else { - req->ret = retval; - req->request_state = _SFS_DONE; - pthread_cond_signal(&(req->done_signal)); - } + /* This is due to be replaced with a proper done queue */ + req->ret = retval; + req->request_state = _SFS_DONE; + pthread_cond_signal(&(req->done_signal)); } sfs_requestor * @@ -67,7 +59,6 @@ req->sfsfd = 0; req->offset = -1; req->ret = 0; - req->orphan = 0; req->buf = NULL; pthread_cond_init(&(req->done_signal), NULL); pthread_mutex_init(&(req->done_signal_lock), NULL); @@ -78,35 +69,31 @@ int _sfs_submit_request(sfs_requestor *req) { - printf("DEBUG: Locking req_lock\n"); pthread_mutex_lock(&(_sfs_mounted[req->sfsid].req_lock)); - printf("DEBUG: Locked req_lock\n"); /* add the request to the end of the list rather than the start */ dlinkAddTail(req, &req->node, &_sfs_mounted[req->sfsid].request_queue); _sfs_mounted[req->sfsid].pending_requests++; - printf("DEBUG: Added %d request\n",req->request_type); pthread_mutex_unlock(&(_sfs_mounted[req->sfsid].req_lock)); -/* And signal that the request has been made */ + /* and signal that the request has been made */ pthread_mutex_lock(&(_sfs_mounted[req->sfsid].req_signal_lock)); pthread_cond_signal(&(_sfs_mounted[req->sfsid].req_signal)); pthread_mutex_unlock(&(_sfs_mounted[req->sfsid].req_signal_lock)); - return(0); } sfs_blockbuf_t * _sfs_read_block(int sfsid, uint diskpos) { -/* This takes an sfsid, and a diskpos, and returns a blockbuf filled in -with the correct data. */ + /* This takes an sfsid, and a diskpos, and returns a blockbuf filled in + with the correct data. */ sfs_blockbuf_t *new; uint64_t dpos; int readlen; printf("DEBUG: _sfs_read_block\n"); -/* Searching for the appropriate block in the clean list */ + /* Searching for the appropriate block in the clean list */ if (_sfs_mounted[sfsid].clean) { _sfs_mounted[sfsid].clean = sfs_splay_find(diskpos,_sfs_mounted[sfsid].clean); if (_sfs_mounted[sfsid].clean->diskpos == diskpos) {