--------------------- PatchSet 357 Date: 2002/12/13 21:25:04 Author: rbcollins Branch: unify-io Tag: (none) Log: move ufs's statfs home Members: src/ufscommon.cc:1.4.10.17->1.4.10.18 src/fs/ufs/store_dir_ufs.cc:1.1.20.19->1.1.20.20 Index: squid3/src/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.cc,v retrieving revision 1.4.10.17 retrieving revision 1.4.10.18 diff -u -r1.4.10.17 -r1.4.10.18 --- squid3/src/ufscommon.cc 13 Dec 2002 21:23:11 -0000 1.4.10.17 +++ squid3/src/ufscommon.cc 13 Dec 2002 21:25:04 -0000 1.4.10.18 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.4.10.17 2002/12/13 21:23:11 rbcollins Exp $ + * $Id: ufscommon.cc,v 1.4.10.18 2002/12/13 21:25:04 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1435,44 +1435,6 @@ /* ========== LOCAL FUNCTIONS ABOVE, GLOBAL FUNCTIONS BELOW ========== */ - -void -UFSSwapDir::statfs(StoreEntry & sentry) const -{ - squidufsinfo_t *ioinfo = (squidufsinfo_t *)fsdata; - int totl_kb = 0; - int free_kb = 0; - int totl_in = 0; - int free_in = 0; - int x; - storeAppendPrintf(&sentry, "First level subdirectories: %d\n", ioinfo->l1); - storeAppendPrintf(&sentry, "Second level subdirectories: %d\n", ioinfo->l2); - storeAppendPrintf(&sentry, "Maximum Size: %d KB\n", max_size); - storeAppendPrintf(&sentry, "Current Size: %d KB\n", cur_size); - storeAppendPrintf(&sentry, "Percent Used: %0.2f%%\n", - 100.0 * cur_size / max_size); - storeAppendPrintf(&sentry, "Filemap bits in use: %d of %d (%d%%)\n", - ioinfo->map->n_files_in_map, ioinfo->map->max_n_files, - percent(ioinfo->map->n_files_in_map, ioinfo->map->max_n_files)); - x = storeDirGetUFSStats(path, &totl_kb, &free_kb, &totl_in, &free_in); - if (0 == x) { - storeAppendPrintf(&sentry, "Filesystem Space in use: %d/%d KB (%d%%)\n", - totl_kb - free_kb, - totl_kb, - percent(totl_kb - free_kb, totl_kb)); - storeAppendPrintf(&sentry, "Filesystem Inodes in use: %d/%d (%d%%)\n", - totl_in - free_in, - totl_in, - percent(totl_in - free_in, totl_in)); - } - storeAppendPrintf(&sentry, "Flags:"); - if (flags.selected) - storeAppendPrintf(&sentry, " SELECTED"); - if (flags.read_only) - storeAppendPrintf(&sentry, " READ-ONLY"); - storeAppendPrintf(&sentry, "\n"); -} - #if 0 static struct cache_dir_option options[] = { Index: squid3/src/fs/ufs/store_dir_ufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/store_dir_ufs.cc,v retrieving revision 1.1.20.19 retrieving revision 1.1.20.20 diff -u -r1.1.20.19 -r1.1.20.20 --- squid3/src/fs/ufs/store_dir_ufs.cc 13 Dec 2002 21:23:11 -0000 1.1.20.19 +++ squid3/src/fs/ufs/store_dir_ufs.cc 13 Dec 2002 21:25:04 -0000 1.1.20.20 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.1.20.19 2002/12/13 21:23:11 rbcollins Exp $ + * $Id: store_dir_ufs.cc,v 1.1.20.20 2002/12/13 21:25:04 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -291,3 +291,40 @@ } return false; } + +void +UFSSwapDir::statfs(StoreEntry & sentry) const +{ + squidufsinfo_t *ioinfo = (squidufsinfo_t *)fsdata; + int totl_kb = 0; + int free_kb = 0; + int totl_in = 0; + int free_in = 0; + int x; + storeAppendPrintf(&sentry, "First level subdirectories: %d\n", ioinfo->l1); + storeAppendPrintf(&sentry, "Second level subdirectories: %d\n", ioinfo->l2); + storeAppendPrintf(&sentry, "Maximum Size: %d KB\n", max_size); + storeAppendPrintf(&sentry, "Current Size: %d KB\n", cur_size); + storeAppendPrintf(&sentry, "Percent Used: %0.2f%%\n", + 100.0 * cur_size / max_size); + storeAppendPrintf(&sentry, "Filemap bits in use: %d of %d (%d%%)\n", + ioinfo->map->n_files_in_map, ioinfo->map->max_n_files, + percent(ioinfo->map->n_files_in_map, ioinfo->map->max_n_files)); + x = storeDirGetUFSStats(path, &totl_kb, &free_kb, &totl_in, &free_in); + if (0 == x) { + storeAppendPrintf(&sentry, "Filesystem Space in use: %d/%d KB (%d%%)\n", + totl_kb - free_kb, + totl_kb, + percent(totl_kb - free_kb, totl_kb)); + storeAppendPrintf(&sentry, "Filesystem Inodes in use: %d/%d (%d%%)\n", + totl_in - free_in, + totl_in, + percent(totl_in - free_in, totl_in)); + } + storeAppendPrintf(&sentry, "Flags:"); + if (flags.selected) + storeAppendPrintf(&sentry, " SELECTED"); + if (flags.read_only) + storeAppendPrintf(&sentry, " READ-ONLY"); + storeAppendPrintf(&sentry, "\n"); +}