--------------------- PatchSet 265 Date: 2002/12/06 02:55:34 Author: rbcollins Branch: unify-io Tag: (none) Log: same open for all of aufs, ufs, disk now Members: src/fs/aufs/store_io_aufs.cc:1.3.12.10->1.3.12.11 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.10 retrieving revision 1.3.12.11 diff -u -r1.3.12.10 -r1.3.12.11 --- squid3/src/fs/aufs/store_io_aufs.cc 6 Dec 2002 02:47:07 -0000 1.3.12.10 +++ squid3/src/fs/aufs/store_io_aufs.cc 6 Dec 2002 02:55:34 -0000 1.3.12.11 @@ -135,7 +135,7 @@ #if !ASYNC_OPEN fd = file_open(path_, flags); if (fd < 0) { - debug(79, 3) ("storeAufsOpen: got failure (%d)\n", errno); + debug(79, 3) ("AUFSFile::open: got failure (%d)\n", errno); errorOccured = true; return; } @@ -145,7 +145,7 @@ #if ASYNC_OPEN aioOpen(path_, flags, mode, AUFSFile::OpenDone, this); #else - openDone(fd, fd, 0); + openDone(fd, NULL, fd, 0); #endif } @@ -193,45 +193,9 @@ storeAufsOpen(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, STIOCB * callback, void *callback_data) { - debug(79, 3) ("storeAufsOpen: fileno %08X\n", e->swap_filen); - if (SD->IO->shedLoad()) { - SD->IO->openFailed(); - return NULL; - } - - /* to consider: make createstate a private UFSStrategy call */ - StoreIOState::Pointer sio = ((UFSStrategy *)SD->IO)->createState (SD, e, callback, callback_data); - sio->mode |= O_RDONLY; - - squidaiostate_t *aio = dynamic_cast (sio.getRaw()); - assert (aio); - - char *path = commonUfsDirFullPath(SD, e->swap_filen, NULL); - DiskFile::Pointer myFile = ((UFSStrategy *)SD->IO)->newFile(path); - - aio->theFile = myFile; - aio->opening = true; - - myFile->open (sio->mode, 0644, aio); - if (myFile->error()) - return NULL; - -#if 0 -#if !ASYNC_OPEN - int fd = file_open(path, O_RDONLY | O_BINARY); - if (fd < 0) { - debug(79, 3) ("storeAufsOpen: got failure (%d)\n", errno); - return NULL; - } -#endif - Opening_FD++; -#if ASYNC_OPEN - aioOpen(path, O_RDONLY | O_BINARY, 0644, storeAufsOpenDone, sio.getRaw()); -#else - storeAufsOpenDone(fd, sio, fd, 0); -#endif -#endif - return sio; + UFSStrategy *IO = dynamic_cast (SD->IO); + assert (IO); + return IO->open (SD, e, file_callback, callback, callback_data); } /* open for creating */