mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
backend: rename bookmark_check
args
- Rename `id` -> `parent_id`, since the function works on the parent directory.
This commit is contained in:
parent
52b3707d2b
commit
9afdfc45d7
3 changed files with 11 additions and 9 deletions
|
@ -128,7 +128,7 @@ typedef int (bookmarkfs_bookmark_check_cb) (
|
||||||
|
|
||||||
typedef int (bookmarkfs_bookmark_check_func) (
|
typedef int (bookmarkfs_bookmark_check_func) (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
uint64_t id,
|
uint64_t parent_id,
|
||||||
struct bookmarkfs_fsck_data const *fsck_data,
|
struct bookmarkfs_fsck_data const *fsck_data,
|
||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
bookmarkfs_bookmark_check_cb *callback,
|
bookmarkfs_bookmark_check_cb *callback,
|
||||||
|
|
|
@ -1857,7 +1857,7 @@ backend_sandbox (
|
||||||
static int
|
static int
|
||||||
bookmark_check (
|
bookmark_check (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
uint64_t id,
|
uint64_t parent_id,
|
||||||
struct bookmarkfs_fsck_data const *fsck_data,
|
struct bookmarkfs_fsck_data const *fsck_data,
|
||||||
uint32_t UNUSED_VAR(flags),
|
uint32_t UNUSED_VAR(flags),
|
||||||
bookmarkfs_bookmark_check_cb *callback,
|
bookmarkfs_bookmark_check_cb *callback,
|
||||||
|
@ -1883,7 +1883,8 @@ bookmark_check (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Unlike bookmark_list(), always fetch the latest entries during fsck.
|
// 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)) {
|
if (unlikely(entry == NULL || entry->name == NULL)) {
|
||||||
return -ESTALE;
|
return -ESTALE;
|
||||||
}
|
}
|
||||||
|
@ -1898,11 +1899,12 @@ bookmark_check (
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (fsck_data == NULL) {
|
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 {
|
} else {
|
||||||
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
||||||
#ifdef BOOKMARKFS_BACKEND_CHROMIUM_WRITE
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2999,7 +2999,7 @@ backend_sandbox (
|
||||||
static int
|
static int
|
||||||
bookmark_check (
|
bookmark_check (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
uint64_t id,
|
uint64_t parent_id,
|
||||||
struct bookmarkfs_fsck_data const *fsck_data,
|
struct bookmarkfs_fsck_data const *fsck_data,
|
||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
bookmarkfs_bookmark_check_cb *callback,
|
bookmarkfs_bookmark_check_cb *callback,
|
||||||
|
@ -3013,7 +3013,7 @@ bookmark_check (
|
||||||
}
|
}
|
||||||
switch (flags & BOOKMARKFS_BOOKMARK_TYPE_MASK) {
|
switch (flags & BOOKMARKFS_BOOKMARK_TYPE_MASK) {
|
||||||
case BOOKMARKFS_BOOKMARK_TYPE(TAG):
|
case BOOKMARKFS_BOOKMARK_TYPE(TAG):
|
||||||
if (id == ctx->tags_root_id) {
|
if (parent_id == ctx->tags_root_id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
|
@ -3050,11 +3050,11 @@ bookmark_check (
|
||||||
qctx.user_data = user_data;
|
qctx.user_data = user_data;
|
||||||
if (fsck_data == NULL) {
|
if (fsck_data == NULL) {
|
||||||
qctx.status = 0;
|
qctx.status = 0;
|
||||||
status = bookmark_do_list(ctx, id, idx, flags, &qctx);
|
status = bookmark_do_list(ctx, parent_id, idx, flags, &qctx);
|
||||||
} else {
|
} else {
|
||||||
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
||||||
#ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE
|
#ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE
|
||||||
status = fsck_apply(ctx, id, fsck_data, &qctx);
|
status = fsck_apply(ctx, parent_id, fsck_data, &qctx);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
dentry_map = qctx.dentry_map;
|
dentry_map = qctx.dentry_map;
|
||||||
|
|
Loading…
Add table
Reference in a new issue