]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Modify the store_open_disk_fd tracking a tad so it tracks open fd's
authoradrian <>
Fri, 21 Dec 2001 06:09:59 +0000 (06:09 +0000)
committeradrian <>
Fri, 21 Dec 2001 06:09:59 +0000 (06:09 +0000)
properly.

src/fs/aufs/store_io_aufs.cc

index eaacb0c4526d473a484f059df69587291c884e5d..afd65a08588b5bb3d2a89f468782e585865a6323 100644 (file)
@@ -71,7 +71,6 @@ storeAufsOpen(SwapDir * SD, StoreEntry * e, STFNCB * file_callback,
 #else
     storeAufsOpenDone(fd, sio, fd, 0);
 #endif
-    store_open_disk_fd++;
     return sio;
 }
 
@@ -126,7 +125,6 @@ storeAufsCreate(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, STIOCB * c
 #else
     storeAufsOpenDone(fd, sio, fd, 0);
 #endif
-    store_open_disk_fd++;
 
     /* now insert into the replacement policy */
     storeAufsDirReplAdd(SD, e);
@@ -284,6 +282,7 @@ storeAufsOpenDone(int unused, void *my_data, int fd, int errflag)
        storeAufsIOCallback(sio, DISK_ERROR);
        return;
     }
+    store_open_disk_fd++;
     aiostate->fd = fd;
     commSetCloseOnExec(fd);
     fd_open(fd, FD_FILE, storeAufsDirFullPath(INDEXSD(sio->swap_dirn), sio->swap_filen, NULL));
@@ -409,12 +408,12 @@ storeAufsIOCallback(storeIOState * sio, int errflag)
     cbdataUnlock(their_data);
     aiostate->fd = -1;
     cbdataFree(sio);
-    store_open_disk_fd--;
     if (fd < 0)
        return;
     debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
     aioClose(fd);
     fd_close(fd);
+    store_open_disk_fd--;
     debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
 }