? cf.data ? libufs.c ? Makefile ? libufs.h ? cf_gen_defines.h ? cf_gen ? cf_parser.c ? squid.conf ? globals.c ? repl_modules.c ? store_modules.c ? string_arrays.c ? squid ? client ? urn.c.mempooled ? unlinkd ? cachemgr.cgi ? fs/Makefile ? fs/aufs/Makefile ? fs/diskd/Makefile ? fs/diskd/diskd ? repl/Makefile ? repl/stamp ? repl/lru/Makefile Index: Makefile.in =================================================================== RCS file: /server/cvs-server/squid/squid/src/Makefile.in,v retrieving revision 1.194 diff -u -r1.194 Makefile.in --- Makefile.in 2000/09/01 12:30:24 1.194 +++ Makefile.in 2000/10/09 14:20:30 @@ -135,6 +135,7 @@ ipc.o \ ipcache.o \ @LEAKFINDER_OBJS@ \ + libufs.o \ logfile.o \ main.o \ mem.o \ Index: fs/diskd/store_dir_diskd.c =================================================================== RCS file: /server/cvs-server/squid/squid/src/fs/diskd/store_dir_diskd.c,v retrieving revision 1.18 diff -u -r1.18 store_dir_diskd.c --- fs/diskd/store_dir_diskd.c 2000/10/06 05:21:58 1.18 +++ fs/diskd/store_dir_diskd.c 2000/10/09 14:20:36 @@ -44,6 +44,7 @@ #include #include +#include "libufs.h" #include "store_diskd.h" #define DefaultLevelOneDirs 16 @@ -84,11 +85,6 @@ MemPool *diskd_state_pool = NULL; static int diskd_initialised = 0; -static char *storeDiskdDirSwapSubDir(SwapDir *, int subdirn); -static int storeDiskdDirCreateDirectory(const char *path, int); -static int storeDiskdDirVerifyCacheDirs(SwapDir *); -static int storeDiskdDirVerifyDirectory(const char *path); -static void storeDiskdDirCreateSwapSubDirs(SwapDir *); static char *storeDiskdDirSwapLogFile(SwapDir *, const char *); static EVH storeDiskdDirRebuildFromDirectory; static EVH storeDiskdDirRebuildFromSwapLog; @@ -125,173 +121,14 @@ static int storeDiskdDirClean(int swap_index); static EVH storeDiskdDirCleanEvent; static int storeDiskdDirIs(SwapDir * sd); -static int storeDiskdFilenoBelongsHere(int fn, int F0, int F1, int F2); static int storeDiskdCleanupDoubleCheck(SwapDir *, StoreEntry *); static void storeDiskdDirStats(SwapDir *, StoreEntry *); -static void storeDiskdDirInitBitmap(SwapDir *); -static int storeDiskdDirValidFileno(SwapDir *, sfileno, int); static void storeDiskdStats(StoreEntry * sentry); static void storeDiskdDirSync(SwapDir *); -/* - * These functions were ripped straight out of the heart of store_dir.c. - * They assume that the given filenum is on a diskd partiton, which may or - * may not be true.. - * XXX this evilness should be tidied up at a later date! - */ - -int -storeDiskdDirMapBitTest(SwapDir * SD, int fn) -{ - sfileno filn = fn; - diskdinfo_t *diskdinfo; - diskdinfo = SD->fsdata; - return file_map_bit_test(diskdinfo->map, filn); -} - -void -storeDiskdDirMapBitSet(SwapDir * SD, int fn) -{ - sfileno filn = fn; - diskdinfo_t *diskdinfo; - diskdinfo = SD->fsdata; - file_map_bit_set(diskdinfo->map, filn); -} - -void -storeDiskdDirMapBitReset(SwapDir * SD, int fn) -{ - sfileno filn = fn; - diskdinfo_t *diskdinfo; - diskdinfo = SD->fsdata; - file_map_bit_reset(diskdinfo->map, filn); -} - -int -storeDiskdDirMapBitAllocate(SwapDir * SD) -{ - diskdinfo_t *diskdinfo = SD->fsdata; - int fn; - fn = file_map_allocate(diskdinfo->map, diskdinfo->suggest); - file_map_bit_set(diskdinfo->map, fn); - diskdinfo->suggest = fn + 1; - return fn; -} - -/* - * Initialise the diskd bitmap - * - * If there already is a bitmap, and the numobjects is larger than currently - * configured, we allocate a new bitmap and 'grow' the old one into it. - */ -static void -storeDiskdDirInitBitmap(SwapDir * sd) -{ - diskdinfo_t *diskdinfo = sd->fsdata; - if (diskdinfo->map == NULL) { - /* First time */ - diskdinfo->map = file_map_create(); - } else if (diskdinfo->map->max_n_files) { - /* it grew, need to expand */ - /* XXX We don't need it anymore .. */ - } - /* else it shrunk, and we leave the old one in place */ -} - static char * -storeDiskdDirSwapSubDir(SwapDir * sd, int subdirn) -{ - diskdinfo_t *diskdinfo = sd->fsdata; - - LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); - assert(0 <= subdirn && subdirn < diskdinfo->l1); - snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%02X", sd->path, subdirn); - return fullfilename; -} - -static int -storeDiskdDirCreateDirectory(const char *path, int should_exist) -{ - int created = 0; - struct stat st; - getCurrentTime(); - if (0 == stat(path, &st)) { - if (S_ISDIR(st.st_mode)) { - debug(20, should_exist ? 3 : 1) ("%s exists\n", path); - } else { - fatalf("Swap directory %s is not a directory.", path); - } - } else if (0 == mkdir(path, 0755)) { - debug(20, should_exist ? 1 : 3) ("%s created\n", path); - created = 1; - } else { - fatalf("Failed to make swap directory %s: %s", - path, xstrerror()); - } - return created; -} - -static int -storeDiskdDirVerifyDirectory(const char *path) -{ - struct stat sb; - if (stat(path, &sb) < 0) { - debug(20, 0) ("%s: %s\n", path, xstrerror()); - return -1; - } - if (S_ISDIR(sb.st_mode) == 0) { - debug(20, 0) ("%s is not a directory\n", path); - return -1; - } - return 0; -} - -/* - * This function is called by storeDiskdDirInit(). If this returns < 0, - * then Squid exits, complains about swap directories not - * existing, and instructs the admin to run 'squid -z' - */ -static int -storeDiskdDirVerifyCacheDirs(SwapDir * sd) -{ - diskdinfo_t *diskdinfo = sd->fsdata; - int j; - const char *path = sd->path; - - if (storeDiskdDirVerifyDirectory(path) < 0) - return -1; - for (j = 0; j < diskdinfo->l1; j++) { - path = storeDiskdDirSwapSubDir(sd, j); - if (storeDiskdDirVerifyDirectory(path) < 0) - return -1; - } - return 0; -} - -static void -storeDiskdDirCreateSwapSubDirs(SwapDir * sd) -{ - diskdinfo_t *diskdinfo = sd->fsdata; - int i, k; - int should_exist; - LOCAL_ARRAY(char, name, MAXPATHLEN); - for (i = 0; i < diskdinfo->l1; i++) { - snprintf(name, MAXPATHLEN, "%s/%02X", sd->path, i); - if (storeDiskdDirCreateDirectory(name, 0)) - should_exist = 0; - else - should_exist = 1; - debug(47, 1) ("Making directories in %s\n", name); - for (k = 0; k < diskdinfo->l2; k++) { - snprintf(name, MAXPATHLEN, "%s/%02X/%02X", sd->path, i, k); - storeDiskdDirCreateDirectory(name, should_exist); - } - } -} - -static char * storeDiskdDirSwapLogFile(SwapDir * sd, const char *ext) { LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN); @@ -424,8 +261,8 @@ fd_note(diskdinfo->wfd, "squid -> diskd"); commSetTimeout(diskdinfo->wfd, -1, NULL, NULL); commSetNonBlocking(diskdinfo->wfd); - storeDiskdDirInitBitmap(sd); - if (storeDiskdDirVerifyCacheDirs(sd) < 0) + libufs_DirInitBitmap(sd, &diskdinfo->ufsinfo); + if (libufs_VerifyCacheDirs(sd, &diskdinfo->ufsinfo) < 0) fatal(errmsg); storeDiskdDirOpenSwapLog(sd); storeDiskdDirRebuild(sd); @@ -683,6 +520,7 @@ int used; /* is swapfile already in use? */ int disk_entry_newer; /* is the log entry newer than current entry? */ double x; + diskdinfo_t *diskdinfo; assert(rb != NULL); /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { @@ -728,7 +566,7 @@ * have the wrong size. */ struct stat sb; - char *p = storeDiskdDirFullPath(SD, s.swap_filen, NULL); + char *p = libufs_StoreDirFullPath(SD, &diskdinfo->ufsinfo, s.swap_filen, NULL); if (s.swap_file_sz < (1 << 17)) { (void) 0; } else if (stat(p, &sb) < 0) { @@ -755,7 +593,8 @@ storeReleaseRequest(e); storeDiskdDirReplRemove(e); if (e->swap_filen > -1) { - storeDiskdDirMapBitReset(SD, e->swap_filen); + diskdinfo = SD->fsdata; + libufs_DirMapBitReset(SD, &diskdinfo->ufsinfo, e->swap_filen); e->swap_filen = -1; e->swap_dirn = -1; } @@ -775,7 +614,7 @@ if ((++rb->counts.scancount & 0xFFFF) == 0) debug(20, 3) (" %7d %s Entries read so far.\n", rb->counts.scancount, rb->sd->path); - if (!storeDiskdDirValidFileno(SD, s.swap_filen, 0)) { + if (!libufs_ValidFileno(SD, &diskdinfo->ufsinfo, s.swap_filen, 0)) { rb->counts.invalid++; continue; } @@ -784,7 +623,8 @@ continue; } e = storeGet(s.key); - used = storeDiskdDirMapBitTest(SD, s.swap_filen); + diskdinfo = SD->fsdata; + used = libufs_DirMapBitTest(SD, &diskdinfo->ufsinfo, s.swap_filen); /* If this URL already exists in the cache, does the swap log * appear to have a newer entry? Compare 'lastref' from the * swap log to e->lastref. */ @@ -841,7 +681,8 @@ storeDiskdDirReplRemove(e); if (e->swap_filen > -1) { /* Make sure we don't actually unlink the file */ - storeDiskdDirMapBitReset(SD, e->swap_filen); + diskdinfo = SD->fsdata; + libufs_DirMapBitReset(SD, &diskdinfo->ufsinfo, e->swap_filen); e->swap_filen = -1; e->swap_dirn = -1; } @@ -923,12 +764,14 @@ rb->entry->d_name); continue; } - if (!storeDiskdFilenoBelongsHere(rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2)) { + diskdinfo = SD->fsdata; + if (!libufs_FilenoBelongsHere(&diskdinfo->ufsinfo, rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2)) { debug(20, 3) ("storeDiskdDirGetNextFile: %08X does not belong in %d/%d/%d\n", rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2); continue; } - used = storeDiskdDirMapBitTest(SD, rb->fn); + diskdinfo = SD->fsdata; + used = libufs_DirMapBitTest(SD, &diskdinfo->ufsinfo, rb->fn); if (used) { debug(20, 3) ("storeDiskdDirGetNextFile: Locked, continuing with next.\n"); continue; @@ -944,10 +787,10 @@ continue; } rb->in_dir = 0; - if (++rb->curlvl2 < diskdinfo->l2) + if (++rb->curlvl2 < diskdinfo->ufsinfo.l2) continue; rb->curlvl2 = 0; - if (++rb->curlvl1 < diskdinfo->l1) + if (++rb->curlvl1 < diskdinfo->ufsinfo.l1) continue; rb->curlvl1 = 0; rb->done = 1; @@ -971,6 +814,7 @@ int clean) { StoreEntry *e = NULL; + diskdinfo_t *diskdinfo; debug(20, 5) ("storeDiskdAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); /* if you call this you'd better be sure file_number is not * already in use! */ @@ -993,7 +837,8 @@ EBIT_CLR(e->flags, KEY_PRIVATE); e->ping_status = PING_NONE; EBIT_CLR(e->flags, ENTRY_VALIDATED); - storeDiskdDirMapBitSet(SD, e->swap_filen); + diskdinfo = SD->fsdata; + libufs_DirMapBitSet(SD, &diskdinfo->ufsinfo, e->swap_filen); storeHashInsert(e, key); /* do it after we clear KEY_PRIVATE */ storeDiskdDirReplAdd(SD, e); return e; @@ -1287,9 +1132,11 @@ static void storeDiskdDirNewfs(SwapDir * sd) { + diskdinfo_t *diskdinfo = sd->fsdata; + debug(47, 3) ("Creating swap space in %s\n", sd->path); - storeDiskdDirCreateDirectory(sd->path, 0); - storeDiskdDirCreateSwapSubDirs(sd); + libufs_CreateDirectory(sd->path, 0); + libufs_CreateSwapSubDirs(sd, &diskdinfo->ufsinfo); } static int @@ -1323,9 +1170,9 @@ D0 = diskd_dir_index[swap_index % N0]; SD = &Config.cacheSwap.swapDirs[D0]; diskdinfo = SD->fsdata; - N1 = diskdinfo->l1; + N1 = diskdinfo->ufsinfo.l1; D1 = (swap_index / N0) % N1; - N2 = diskdinfo->l2; + N2 = diskdinfo->ufsinfo.l2; D2 = ((swap_index / N0) / N1) % N2; snprintf(p1, SQUID_MAXPATHLEN, "%s/%02X/%02X", Config.cacheSwap.swapDirs[D0].path, D1, D2); @@ -1345,9 +1192,9 @@ if (sscanf(de->d_name, "%X", &swapfileno) != 1) continue; fn = swapfileno; /* XXX should remove this cruft ! */ - if (storeDiskdDirValidFileno(SD, fn, 1)) - if (storeDiskdDirMapBitTest(SD, fn)) - if (storeDiskdFilenoBelongsHere(fn, D0, D1, D2)) + if (libufs_ValidFileno(SD, &diskdinfo->ufsinfo, fn, 1)) + if (libufs_DirMapBitTest(SD, &diskdinfo->ufsinfo, fn)) + if (libufs_FilenoBelongsHere(&diskdinfo->ufsinfo, fn, D0, D1, D2)) continue; #if USE_TRUNCATE if (!stat(de->d_name, &sb)) @@ -1402,7 +1249,7 @@ continue; diskd_dir_index[n++] = i; diskdinfo = sd->fsdata; - j += (diskdinfo->l1 * diskdinfo->l2); + j += (diskdinfo->ufsinfo.l1 * diskdinfo->ufsinfo.l2); } assert(n == n_diskd_dirs); /* @@ -1428,46 +1275,6 @@ return 0; } -/* - * Does swapfile number 'fn' belong in cachedir #F0, - * level1 dir #F1, level2 dir #F2? - */ -static int -storeDiskdFilenoBelongsHere(int fn, int F0, int F1, int F2) -{ - int D1, D2; - int L1, L2; - int filn = fn; - diskdinfo_t *diskdinfo; - assert(F0 < Config.cacheSwap.n_configured); - diskdinfo = Config.cacheSwap.swapDirs[F0].fsdata; - L1 = diskdinfo->l1; - L2 = diskdinfo->l2; - D1 = ((filn / L2) / L2) % L1; - if (F1 != D1) - return 0; - D2 = (filn / L2) % L2; - if (F2 != D2) - return 0; - return 1; -} - -int -storeDiskdDirValidFileno(SwapDir * SD, sfileno filn, int flag) -{ - diskdinfo_t *diskdinfo = SD->fsdata; - if (filn < 0) - return 0; - /* - * If flag is set it means out-of-range file number should - * be considered invalid. - */ - if (flag) - if (filn > diskdinfo->map->max_n_files) - return 0; - return 1; -} - void storeDiskdDirMaintain(SwapDir * SD) { @@ -1580,9 +1387,10 @@ void storeDiskdDirUnlinkFile(SwapDir * SD, sfileno f) { + diskdinfo_t *diskdinfo = SD->fsdata; debug(79, 3) ("storeDiskdDirUnlinkFile: unlinking fileno %08X\n", f); /* storeDiskdDirMapBitReset(SD, f); */ - unlinkdUnlink(storeDiskdDirFullPath(SD, f, NULL)); + unlinkdUnlink(libufs_StoreDirFullPath(SD, &diskdinfo->ufsinfo, f, NULL)); } /* @@ -1651,48 +1459,10 @@ storeDiskdDirStats(SwapDir * SD, StoreEntry * sentry) { diskdinfo_t *diskdinfo; -#if HAVE_STATVFS - struct statvfs sfs; -#endif diskdinfo = SD->fsdata; - storeAppendPrintf(sentry, "First level subdirectories: %d\n", diskdinfo->l1); - storeAppendPrintf(sentry, "Second level subdirectories: %d\n", diskdinfo->l2); - storeAppendPrintf(sentry, "Maximum Size: %d KB\n", SD->max_size); - storeAppendPrintf(sentry, "Current Size: %d KB\n", SD->cur_size); - storeAppendPrintf(sentry, "Percent Used: %0.2f%%\n", - 100.0 * SD->cur_size / SD->max_size); - storeAppendPrintf(sentry, "Filemap bits in use: %d of %d (%d%%)\n", - diskdinfo->map->n_files_in_map, diskdinfo->map->max_n_files, - percent(diskdinfo->map->n_files_in_map, diskdinfo->map->max_n_files)); -#if HAVE_STATVFS -#define fsbtoblk(num, fsbs, bs) \ - (((fsbs) != 0 && (fsbs) < (bs)) ? \ - (num) / ((bs) / (fsbs)) : (num) * ((fsbs) / (bs))) - if (!statvfs(SD->path, &sfs)) { - storeAppendPrintf(sentry, "Filesystem Space in use: %d/%d KB (%d%%)\n", - fsbtoblk((sfs.f_blocks - sfs.f_bfree), sfs.f_frsize, 1024), - fsbtoblk(sfs.f_blocks, sfs.f_frsize, 1024), - percent(sfs.f_blocks - sfs.f_bfree, sfs.f_blocks)); - storeAppendPrintf(sentry, "Filesystem Inodes in use: %d/%d (%d%%)\n", - sfs.f_files - sfs.f_ffree, sfs.f_files, - percent(sfs.f_files - sfs.f_ffree, sfs.f_files)); - } -#endif - storeAppendPrintf(sentry, "Flags:"); - if (SD->flags.selected) - storeAppendPrintf(sentry, " SELECTED"); - if (SD->flags.read_only) - storeAppendPrintf(sentry, " READ-ONLY"); - storeAppendPrintf(sentry, "\n"); -#if OLD_UNUSED_CODE -#if !HEAP_REPLACEMENT - storeAppendPrintf(sentry, "LRU Expiration Age: %6.2f days\n", - (double) storeDiskdDirExpiredReferenceAge(SD) / 86400.0); -#else - storeAppendPrintf(sentry, "Storage Replacement Threshold:\t%f\n", - heap_peepminkey(sd.repl.heap.heap)); -#endif -#endif /* OLD_UNUSED_CODE */ + + libufs_DirStats(SD, &diskdinfo->ufsinfo, sentry); + storeAppendPrintf(sentry, "Pending operations: %d\n", diskdinfo->away); } @@ -1764,8 +1534,8 @@ "diskd", s->path, s->max_size >> 10, - diskdinfo->l1, - diskdinfo->l2); + diskdinfo->ufsinfo.l1, + diskdinfo->ufsinfo.l2); } /* @@ -1779,30 +1549,12 @@ file_close(diskdinfo->swaplog_fd); diskdinfo->swaplog_fd = -1; } - filemapFreeMemory(diskdinfo->map); + libufs_FreeMemory(s, &diskdinfo->ufsinfo); xfree(diskdinfo); s->fsdata = NULL; /* Will aid debugging... */ } -char * -storeDiskdDirFullPath(SwapDir * SD, sfileno filn, char *fullpath) -{ - LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); - diskdinfo_t *diskdinfo = SD->fsdata; - int L1 = diskdinfo->l1; - int L2 = diskdinfo->l2; - if (!fullpath) - fullpath = fullfilename; - fullpath[0] = '\0'; - snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X", - SD->path, - ((filn / L2) / L2) % L1, - (filn / L2) % L2, - filn); - return fullpath; -} - /* * storeDiskdCleanupDoubleCheck * @@ -1812,12 +1564,13 @@ storeDiskdCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { struct stat sb; + diskdinfo_t *diskdinfo = sd->fsdata; - if (stat(storeDiskdDirFullPath(sd, e->swap_filen, NULL), &sb) < 0) { + if (stat(libufs_StoreDirFullPath(sd, &diskdinfo->ufsinfo, e->swap_filen, NULL), &sb) < 0) { debug(20, 0) ("storeDiskdCleanupDoubleCheck: MISSING SWAP FILE\n"); debug(20, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); debug(20, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", - storeDiskdDirFullPath(sd, e->swap_filen, NULL)); + libufs_StoreDirFullPath(sd, &diskdinfo->ufsinfo, e->swap_filen, NULL)); storeEntryDump(e, 0); return -1; } @@ -1825,7 +1578,7 @@ debug(20, 0) ("storeDiskdCleanupDoubleCheck: SIZE MISMATCH\n"); debug(20, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); debug(20, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", - storeDiskdDirFullPath(sd, e->swap_filen, NULL)); + libufs_StoreDirFullPath(sd, &diskdinfo->ufsinfo, e->swap_filen, NULL)); debug(20, 0) ("storeDiskdCleanupDoubleCheck: ENTRY SIZE: %d, FILE SIZE: %d\n", e->swap_file_sz, (int) sb.st_size); storeEntryDump(e, 0); @@ -1881,11 +1634,11 @@ sd->index = index; sd->path = xstrdup(path); sd->max_size = size; - diskdinfo->l1 = l1; - diskdinfo->l2 = l2; - diskdinfo->swaplog_fd = -1; - diskdinfo->map = NULL; /* Debugging purposes */ - diskdinfo->suggest = 0; + diskdinfo->ufsinfo.l1 = l1; + diskdinfo->ufsinfo.l2 = l2; + diskdinfo->ufsinfo.swaplog_fd = -1; + diskdinfo->ufsinfo.map = NULL; /* Debugging purposes */ + diskdinfo->ufsinfo.suggest = 0; diskdinfo->magic1 = magic1; diskdinfo->magic2 = magic2; sd->flags.read_only = read_only; Index: fs/diskd/store_diskd.h =================================================================== RCS file: /server/cvs-server/squid/squid/src/fs/diskd/store_diskd.h,v retrieving revision 1.5 diff -u -r1.5 store_diskd.h --- fs/diskd/store_diskd.h 2000/07/16 07:28:38 1.5 +++ fs/diskd/store_diskd.h 2000/10/09 14:20:36 @@ -7,6 +7,8 @@ #ifndef __STORE_DISKD_H__ #define __STORE_DISKD_H__ +#include "libufs.h" + /* * MAGIC2 is the point at which we start blocking on msgsnd/msgrcv. * If a queue has MAGIC2 (or more) messages away, then we read the @@ -16,11 +18,10 @@ */ struct _diskdinfo_t { + ufsinfo_t ufsinfo; + int swaplog_fd; - int l1; - int l2; - fileMap *map; - int suggest; + int smsgid; int rmsgid; int wfd; @@ -89,9 +90,6 @@ /* The diskd_state memory pool */ extern MemPool *diskd_state_pool; -extern void storeDiskdDirMapBitReset(SwapDir *, sfileno); -extern int storeDiskdDirMapBitAllocate(SwapDir *); -extern char *storeDiskdDirFullPath(SwapDir * SD, sfileno filn, char *fullpath); extern void storeDiskdDirUnlinkFile(SwapDir *, sfileno); extern void storeDiskdDirReplAdd(SwapDir *, StoreEntry *); extern void storeDiskdDirReplRemove(StoreEntry *); Index: fs/diskd/store_io_diskd.c =================================================================== RCS file: /server/cvs-server/squid/squid/src/fs/diskd/store_io_diskd.c,v retrieving revision 1.16 diff -u -r1.16 store_io_diskd.c --- fs/diskd/store_io_diskd.c 2000/10/06 05:00:24 1.16 +++ fs/diskd/store_io_diskd.c 2000/10/09 14:20:37 @@ -40,6 +40,7 @@ #include #include +#include "libufs.h" #include "store_diskd.h" static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, int, int); @@ -86,7 +87,7 @@ diskdstate->id = diskd_stats.sio_id++; buf = storeDiskdShmGet(SD, &shm_offset); - xstrncpy(buf, storeDiskdDirFullPath(SD, f, NULL), SHMBUF_BLKSZ); + xstrncpy(buf, libufs_StoreDirFullPath(SD, &diskdinfo->ufsinfo, f, NULL), SHMBUF_BLKSZ); x = storeDiskdSend(_MQD_OPEN, SD, diskdstate->id, @@ -124,7 +125,7 @@ return NULL; } /* Allocate a number */ - f = storeDiskdDirMapBitAllocate(SD); + f = libufs_DirMapBitAllocate(SD, &diskdinfo->ufsinfo); debug(81, 3) ("storeDiskdCreate: fileno %08X\n", f); sio = memAllocate(MEM_STORE_IO); @@ -145,7 +146,7 @@ diskdstate->id = diskd_stats.sio_id++; buf = storeDiskdShmGet(SD, &shm_offset); - xstrncpy(buf, storeDiskdDirFullPath(SD, f, NULL), SHMBUF_BLKSZ); + xstrncpy(buf, libufs_StoreDirFullPath(SD, &diskdinfo->ufsinfo, f, NULL), SHMBUF_BLKSZ); x = storeDiskdSend(_MQD_OPEN, SD, diskdstate->id, @@ -269,7 +270,7 @@ debug(81, 3) ("storeDiskdUnlink: dirno %d, fileno %08X\n", SD->index, e->swap_filen); storeDiskdDirReplRemove(e); - storeDiskdDirMapBitReset(SD, e->swap_filen); + libufs_DirMapBitReset(SD, &diskdinfo->ufsinfo, e->swap_filen); if (diskdinfo->away >= diskdinfo->magic1) { /* Damn, we need to issue a sync unlink here :( */ debug(50, 2) ("storeDiskUnlink: Out of queue space, sync unlink\n"); @@ -278,7 +279,7 @@ } /* We can attempt a diskd unlink */ buf = storeDiskdShmGet(SD, &shm_offset); - xstrncpy(buf, storeDiskdDirFullPath(SD, e->swap_filen, NULL), SHMBUF_BLKSZ); + xstrncpy(buf, libufs_StoreDirFullPath(SD, &diskdinfo->ufsinfo, e->swap_filen, NULL), SHMBUF_BLKSZ); x = storeDiskdSend(_MQD_UNLINK, SD, e->swap_filen,