diff --git a/src/backend.h b/src/backend.h index 60a40a4..f0b59ae 100644 --- a/src/backend.h +++ b/src/backend.h @@ -128,7 +128,7 @@ typedef int (bookmarkfs_bookmark_check_cb) ( typedef int (bookmarkfs_bookmark_check_func) ( void *backend_ctx, - uint64_t id, + uint64_t parent_id, struct bookmarkfs_fsck_data const *fsck_data, uint32_t flags, bookmarkfs_bookmark_check_cb *callback, diff --git a/src/backend_chromium.c b/src/backend_chromium.c index 8de4ce0..2fd0f9f 100644 --- a/src/backend_chromium.c +++ b/src/backend_chromium.c @@ -1857,7 +1857,7 @@ backend_sandbox ( static int bookmark_check ( void *backend_ctx, - uint64_t id, + uint64_t parent_id, struct bookmarkfs_fsck_data const *fsck_data, uint32_t UNUSED_VAR(flags), bookmarkfs_bookmark_check_cb *callback, @@ -1883,7 +1883,8 @@ bookmark_check ( } } // Unlike bookmark_list(), always fetch the latest entries during fsck. - struct node_entry const *entry = lookup_id(ctx->id_map, id, NULL, NULL); + struct node_entry const *entry + = lookup_id(ctx->id_map, parent_id, NULL, NULL); if (unlikely(entry == NULL || entry->name == NULL)) { return -ESTALE; } @@ -1898,11 +1899,12 @@ bookmark_check ( goto end; } if (fsck_data == NULL) { - status = fsck_next(ctx, id, children, &idx, callback, user_data); + status = fsck_next(ctx, parent_id, children, &idx, callback, + user_data); } else { debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY)); #ifdef BOOKMARKFS_BACKEND_CHROMIUM_WRITE - status = fsck_apply(ctx, id, fsck_data, callback, user_data); + status = fsck_apply(ctx, parent_id, fsck_data, callback, user_data); #endif } diff --git a/src/backend_firefox.c b/src/backend_firefox.c index e0ccc5d..f111501 100644 --- a/src/backend_firefox.c +++ b/src/backend_firefox.c @@ -2999,7 +2999,7 @@ backend_sandbox ( static int bookmark_check ( void *backend_ctx, - uint64_t id, + uint64_t parent_id, struct bookmarkfs_fsck_data const *fsck_data, uint32_t flags, bookmarkfs_bookmark_check_cb *callback, @@ -3013,7 +3013,7 @@ bookmark_check ( } switch (flags & BOOKMARKFS_BOOKMARK_TYPE_MASK) { case BOOKMARKFS_BOOKMARK_TYPE(TAG): - if (id == ctx->tags_root_id) { + if (parent_id == ctx->tags_root_id) { break; } // fallthrough @@ -3050,11 +3050,11 @@ bookmark_check ( qctx.user_data = user_data; if (fsck_data == NULL) { qctx.status = 0; - status = bookmark_do_list(ctx, id, idx, flags, &qctx); + status = bookmark_do_list(ctx, parent_id, idx, flags, &qctx); } else { debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY)); #ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE - status = fsck_apply(ctx, id, fsck_data, &qctx); + status = fsck_apply(ctx, parent_id, fsck_data, &qctx); #endif } dentry_map = qctx.dentry_map;