Author: adrian.chadd
Date: Sun Apr 26 07:27:15 2009
New Revision: 13986
Added:
branches/LUSCA_HEAD/libsqstore/store_file_ufs.h
Modified:
branches/LUSCA_HEAD/libsqstore/store_log.c
Log:
Start fleshing out some UFS store file routines; in the "wrong" place for
now.
(I'll move them to a separate file later.)
Added: branches/LUSCA_HEAD/libsqstore/store_file_ufs.h
==============================================================================
--- (empty file)
+++ branches/LUSCA_HEAD/libsqstore/store_file_ufs.h Sun Apr 26 07:27:15 2009
@@ -0,0 +1,6 @@
+#ifndef __LIBSQSTORE_STORE_FILE_UFS_H__
+#define __LIBSQSTORE_STORE_FILE_UFS_H__
+
+extern int store_ufs_createPath(const char *prefix, int swap_filen, int
L1, int L2, char *buf);
+
+#endif
Modified: branches/LUSCA_HEAD/libsqstore/store_log.c
==============================================================================
--- branches/LUSCA_HEAD/libsqstore/store_log.c (original)
+++ branches/LUSCA_HEAD/libsqstore/store_log.c Sun Apr 26 07:27:15 2009
@@ -7,6 +7,7 @@
#include "../include/squid_md5.h"
#include "../libcore/kb.h"
+#include "../libcore/tools.h" /* for SQUID_MAXPATHLEN */
#include "store_mgr.h"
#include "store_log.h"
@@ -19,3 +20,23 @@
"SWAP_LOG_MAX"
};
+/*
+ * This shouldn't be here for now.. :)
+ */
+
+/*
+ * Create a UFS path given the component bits.
+ *
+ * "buf" must be SQUID_MAXPATHLEN.
+ */
+int
+store_ufs_createPath(const char *prefix, int filn, int L1, int L2, char
*buf)
+{
+ buf[0] = '\0';
+ snprintf(buf, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X",
+ prefix,
+ ((filn / L2) / L2) % L1,
+ (filn / L2) % L2,
+ filn);
+ return 1;
+}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---