Author: adrian.chadd
Date: Sun Apr 26 09:27:31 2009
New Revision: 13990

Added:
    branches/LUSCA_HEAD/libsqstore/store_file_ufs.c
Modified:
    branches/LUSCA_HEAD/libsqstore/Makefile.am
    branches/LUSCA_HEAD/libsqstore/store_log.c

Log:
Create store_file_ufs.c; start migrating UFS specific magic into here.



Modified: branches/LUSCA_HEAD/libsqstore/Makefile.am
==============================================================================
--- branches/LUSCA_HEAD/libsqstore/Makefile.am  (original)
+++ branches/LUSCA_HEAD/libsqstore/Makefile.am  Sun Apr 26 09:27:31 2009
@@ -1,7 +1,8 @@
  ## Process this file with automake to produce Makefile.in

  libsqstore_a_SOURCES = \
-       store_log.c
+       store_log.c \
+       store_file_ufs.c

  noinst_LIBRARIES = \
        libsqstore.a

Added: branches/LUSCA_HEAD/libsqstore/store_file_ufs.c
==============================================================================
--- (empty file)
+++ branches/LUSCA_HEAD/libsqstore/store_file_ufs.c     Sun Apr 26 09:27:31 2009
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include "../include/config.h"
+#include "../include/squid_md5.h"
+
+#include "../libcore/kb.h"
+#include "../libcore/tools.h"  /* for SQUID_MAXPATHLEN */
+
+#include "store_mgr.h"
+#include "store_log.h"
+
+#include "store_file_ufs.h"
+
+/*
+ * 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;
+}
+
+/*
+ * Create a UFS directory path given the component bits.
+ */
+int
+store_ufs_createDir(const char *prefix, int L1, int L2, char *buf)
+{
+    buf[0] = '\0';
+    snprintf(buf, SQUID_MAXPATHLEN, "%s/%02X/%02X", prefix, L1, L2);
+    return 1;
+}

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 09:27:31 2009
@@ -8,7 +8,6 @@

  #include "../libcore/varargs.h"
  #include "../libcore/kb.h"
-#include "../libcore/tools.h"  /* for SQUID_MAXPATHLEN */

  #include "store_mgr.h"
  #include "store_log.h"
@@ -20,32 +19,3 @@
      "SWAP_LOG_VERSION",
      "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;
-}
-
-int
-store_ufs_createDir(const char *prefix, int L1, int L2, char *buf)
-{
-    buf[0] = '\0';
-    snprintf(buf, SQUID_MAXPATHLEN, "%s/%02X/%02X", prefix, L1, L2);
-    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
-~----------~----~----~----~------~----~------~--~---

Reply via email to