--------------------- PatchSet 336 Date: 2002/12/12 23:57:04 Author: rbcollins Branch: unify-io Tag: (none) Log: extract method Members: src/fs/aufs/store_asyncufs.h:1.2.12.30->1.2.12.31 src/fs/aufs/store_io_aufs.cc:1.3.12.30->1.3.12.31 Index: squid3/src/fs/aufs/store_asyncufs.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/aufs/Attic/store_asyncufs.h,v retrieving revision 1.2.12.30 retrieving revision 1.2.12.31 diff -u -r1.2.12.30 -r1.2.12.31 --- squid3/src/fs/aufs/store_asyncufs.h 12 Dec 2002 23:42:23 -0000 1.2.12.30 +++ squid3/src/fs/aufs/store_asyncufs.h 12 Dec 2002 23:57:04 -0000 1.2.12.31 @@ -138,6 +138,7 @@ void writeCompleted(int errflag, size_t len); void writeDone(int fd, int errflag, size_t len); +void queueWrite(char *buf, size_t size, off_t offset, FREE * free_func); private: CBDATA_CLASS(squidaiostate_t); void openDone(); Index: squid3/src/fs/aufs/store_io_aufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/aufs/Attic/store_io_aufs.cc,v retrieving revision 1.3.12.30 retrieving revision 1.3.12.31 diff -u -r1.3.12.30 -r1.3.12.31 --- squid3/src/fs/aufs/store_io_aufs.cc 12 Dec 2002 23:42:23 -0000 1.3.12.30 +++ squid3/src/fs/aufs/store_io_aufs.cc 12 Dec 2002 23:57:04 -0000 1.3.12.31 @@ -268,6 +268,19 @@ assert (0); } +void +squidaiostate_t::queueWrite(char *buf, size_t size, off_t offset, FREE * free_func) +{ + debug(79, 3) ("storeAufsWrite: queuing write\n"); + struct _queued_write *q; + q = new _queued_write; + q->buf = buf; + q->size = size; + q->offset = offset; + q->free_func = free_func; + linklistPush(&pending_writes, q); +} + /* Write */ void squidaiostate_t::write(char *buf, size_t size, off_t offset, FREE * free_func) @@ -276,26 +289,13 @@ swap_dirn, swap_filen, fd); if (fd < 0) { /* disk file not opened yet */ - struct _queued_write *q; assert(creating); - q = new _queued_write; - q->buf = buf; - q->size = size; - q->offset = offset; - q->free_func = free_func; - linklistPush(&pending_writes, q); + queueWrite(buf, size, offset, free_func); return; } #if ASYNC_WRITE if (writing) { - struct _queued_write *q; - debug(79, 3) ("storeAufsWrite: queuing write\n"); - q = new _queued_write; - q->buf = buf; - q->size = size; - q->offset = offset; - q->free_func = free_func; - linklistPush(&(pending_writes), q); + queueWrite(buf, size, offset, free_func); return; } writing = true;