--------------------- PatchSet 394 Date: 2002/12/15 06:21:20 Author: rbcollins Branch: unify-io Tag: (none) Log: repeat Members: src/fs/coss/store_coss.h:1.3.10.31->1.3.10.32 src/fs/coss/store_dir_coss.cc:1.4.10.38->1.4.10.39 src/fs/coss/store_io_coss.cc:1.3.10.18->1.3.10.19 Index: squid3/src/fs/coss/store_coss.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_coss.h,v retrieving revision 1.3.10.31 retrieving revision 1.3.10.32 diff -u -r1.3.10.31 -r1.3.10.32 --- squid3/src/fs/coss/store_coss.h 15 Dec 2002 06:19:21 -0000 1.3.10.31 +++ squid3/src/fs/coss/store_coss.h 15 Dec 2002 06:21:20 -0000 1.3.10.32 @@ -38,8 +38,7 @@ /* Per-storedir info */ struct _cossinfo { - //dlink_list membufs; - struct _cossmembuf *current_membuf; + //struct _cossmembuf *current_membuf; size_t current_offset; /* in Blocks */ int numcollisions; dlink_list index; @@ -119,6 +118,7 @@ int swaplog_fd; int count; dlink_list membufs; + struct _cossmembuf *current_membuf; }; extern off_t storeCossAllocate(CossSwapDir * SD, const StoreEntry * e, int which); Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.4.10.38 retrieving revision 1.4.10.39 diff -u -r1.4.10.38 -r1.4.10.39 --- squid3/src/fs/coss/store_dir_coss.cc 15 Dec 2002 06:19:21 -0000 1.4.10.38 +++ squid3/src/fs/coss/store_dir_coss.cc 15 Dec 2002 06:21:20 -0000 1.4.10.39 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.4.10.38 2002/12/15 06:19:21 rbcollins Exp $ + * $Id: store_dir_coss.cc,v 1.4.10.39 2002/12/15 06:21:20 rbcollins Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -739,7 +739,6 @@ cs->current_offset = 0; cs->numcollisions = 0; - cs->current_membuf = NULL; cs->index.head = NULL; cs->index.tail = NULL; @@ -839,7 +838,7 @@ return result; } -CossSwapDir::CossSwapDir() : fd (-1), swaplog_fd(-1), count(0) +CossSwapDir::CossSwapDir() : fd (-1), swaplog_fd(-1), count(0), current_membuf (NULL) { membufs.head = NULL; membufs.tail = NULL; Index: squid3/src/fs/coss/store_io_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_io_coss.cc,v retrieving revision 1.3.10.18 retrieving revision 1.3.10.19 diff -u -r1.3.10.18 -r1.3.10.19 --- squid3/src/fs/coss/store_io_coss.cc 15 Dec 2002 06:19:21 -0000 1.3.10.18 +++ squid3/src/fs/coss/store_io_coss.cc 15 Dec 2002 06:21:20 -0000 1.3.10.19 @@ -1,6 +1,6 @@ /* - * $Id: store_io_coss.cc,v 1.3.10.18 2002/12/15 06:19:21 rbcollins Exp $ + * $Id: store_io_coss.cc,v 1.3.10.19 2002/12/15 06:21:20 rbcollins Exp $ * * DEBUG: section 79 Storage Manager COSS Interface * AUTHOR: Eric Stern @@ -115,25 +115,25 @@ * tried to allocate past the end of the disk, so wrap * back to the beginning */ - cs->current_membuf->flags.full = 1; - cs->current_membuf->diskend = cs->current_offset - 1; + SD->current_membuf->flags.full = 1; + SD->current_membuf->diskend = cs->current_offset - 1; cs->current_offset = 0; /* wrap back to beginning */ debug(79, 2) ("storeCossAllocate: wrap to 0\n"); newmb = storeCossCreateMemBuf(SD, 0, checkf, &coll); - cs->current_membuf = newmb; + SD->current_membuf = newmb; /* Check if we have overflowed the MemBuf */ - } else if ((cs->current_offset + allocsize) > cs->current_membuf->diskend) { + } else if ((cs->current_offset + allocsize) > SD->current_membuf->diskend) { /* * Skip the blank space at the end of the stripe. start over. */ - cs->current_membuf->flags.full = 1; - cs->current_offset = cs->current_membuf->diskend + 1; + SD->current_membuf->flags.full = 1; + cs->current_offset = SD->current_membuf->diskend + 1; debug(79, 2) ("storeCossAllocate: New offset - %ld\n", (long int) cs->current_offset); newmb = storeCossCreateMemBuf(SD, cs->current_offset, checkf, &coll); - cs->current_membuf = newmb; + SD->current_membuf = newmb; } /* If we didn't get a collision, then update the current offset and return it */ if (coll == 0) { @@ -474,7 +474,7 @@ if (t->flags.writing) sleep(5); /* XXX EEEWWW! */ lseek(fd, t->diskstart, SEEK_SET); - end = (t == cs->current_membuf) ? cs->current_offset : t->diskend; + end = (t == current_membuf) ? cs->current_offset : t->diskend; FD_WRITE_METHOD(fd, t->buffer, end - t->diskstart); } } @@ -562,8 +562,8 @@ { CossInfo *cs = (CossInfo *) sd->fsdata; CossMemBuf *newmb = storeCossCreateMemBuf(sd, cs->current_offset, -1, NULL); - assert(!cs->current_membuf); - cs->current_membuf = newmb; + assert(!sd->current_membuf); + sd->current_membuf = newmb; } /*