Remove the "second hand" FID / MID database, which we didn't (and couldn't safely...
authorbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Sat, 22 Jan 2011 20:18:04 +0000 (20:18 +0000)
committerbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Sat, 22 Jan 2011 20:18:04 +0000 (20:18 +0000)
(merge rev 2526 from mapistore_v2 branch)

git-svn-id: https://svn.openchange.org/openchange@2527 71d39326-ef09-db11-b2a4-00e04c779ad1

trunk/mapiproxy/libmapistore/mapistore_private.h
trunk/mapiproxy/libmapistore/mapistore_processing.c

index 0a0b59b4477b61d9ea3d37f57714eafc4806d79f..a176528aa3618823e94a07e31a3fac9cb67a90e2 100644 (file)
@@ -147,9 +147,8 @@ struct mapistoredb_context {
    Identifier mapping context.
 
    This structure stores PR_MID and PR_FID identifiers to backend
-   identifiers mapping. It points on 2 databases, one with "in use"
-   identifiers and another one with a list of "free identifiers" which
-   are added when an object is deleted, moved, etc.
+   identifiers mapping. It points to a database containing the used
+   identifiers.
 
    The last_id structure member references the last identifier value
    which got created. There is no identifier available with a value
@@ -157,7 +156,6 @@ struct mapistoredb_context {
  */
 struct id_mapping_context {
        struct tdb_wrap         *used_ctx;
-       struct tdb_wrap         *free_ctx;
        uint64_t                last_id;
 };
 
@@ -205,7 +203,6 @@ struct indexing_context_list {
 #define        MAPISTORE_DB_LAST_ID_VAL        0x15000
 
 #define        MAPISTORE_DB_NAME_USED_ID       "mapistore_id_mapping_used.tdb"
-#define        MAPISTORE_DB_NAME_FREE_ID       "mapistore_id_mapping_free.tdb"
 
 __BEGIN_DECLS
 
index cd32b8ed0caaf81997ac4371b5d6810c925cde2d..4cc32b5b559c15affb5e143d5e75f275536c9e32 100644 (file)
@@ -154,7 +154,7 @@ int mapistore_init_mapping_context(struct processing_context *pctx)
 
        mem_ctx = talloc_named(NULL, 0, "mapistore_init_mapping_context");
 
-       /* Step 1. Open/Create the used ID database */
+       /* Open/Create the used ID database */
        if (!pctx->mapping_ctx->used_ctx) {
                dbpath = talloc_asprintf(mem_ctx, "%s/%s", mapistore_get_mapping_path(), MAPISTORE_DB_NAME_USED_ID);
                pctx->mapping_ctx->used_ctx = tdb_wrap_open(pctx, dbpath, 0, 0, O_RDWR|O_CREAT, 0600);
@@ -167,20 +167,7 @@ int mapistore_init_mapping_context(struct processing_context *pctx)
                }
        }
 
-       /* Step 2. Open/Create the free ID database */
-       if (!pctx->mapping_ctx->free_ctx) {
-               dbpath = talloc_asprintf(mem_ctx, "%s/%s", mapistore_get_mapping_path(), MAPISTORE_DB_NAME_FREE_ID);
-               pctx->mapping_ctx->free_ctx = tdb_wrap_open(pctx, dbpath, 0, 0, O_RDWR|O_CREAT, 0600);
-               talloc_free(dbpath);
-               if (!pctx->mapping_ctx->free_ctx) {
-                       DEBUG(3, ("[%s:%d]: %s\n", __FUNCTION__, __LINE__, strerror(errno)));
-                       talloc_free(mem_ctx);
-                       talloc_free(pctx->mapping_ctx);
-                       return MAPISTORE_ERR_DATABASE_INIT;
-               }
-       }
-
-       /* Step 3. Retrieve the last ID value */
+       /* Retrieve the last ID value */
        key.dptr = (unsigned char *) MAPISTORE_DB_LAST_ID_KEY;
        key.dsize = strlen(MAPISTORE_DB_LAST_ID_KEY);