backend: rename backend_sync -> bookmark_sync

This commit is contained in:
CismonX 2025-01-24 23:07:22 +08:00
parent bff21c54b1
commit 10ad224b03
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
6 changed files with 39 additions and 39 deletions

View file

@ -1404,7 +1404,6 @@ struct bookmarkfs_backend @{
bookmarkfs_backend_init_func *backend_init;
bookmarkfs_backend_mkfs_func *backend_mkfs;
bookmarkfs_backend_sandbox_func *backend_sandbox;
bookmarkfs_backend_sync_func *backend_sync;
bookmarkfs_bookmark_get_func *bookmark_get;
bookmarkfs_bookmark_list_func *bookmark_list;
@ -1416,6 +1415,7 @@ struct bookmarkfs_backend @{
bookmarkfs_bookmark_permute_func *bookmark_permute;
bookmarkfs_bookmark_rename_func *bookmark_rename;
bookmarkfs_bookmark_set_func *bookmark_set;
bookmarkfs_bookmark_sync_func *bookmark_sync;
bookmarkfs_object_free_func *object_free;
@};
@ -1581,8 +1581,8 @@ Indicates that the @option{-o no_landlock} option is given to
Indicates that the backend is launched from @command{fsck.bookmarkfs}.
The backend must claim exclusive access to the bookmark storage, and only
the @code{bookmark_lookup}, @code{bookmark_list} and @code{bookmark_fsck}
functions will be called on the bookmarks.
the @code{bookmark_lookup}, @code{bookmark_list}, @code{bookmark_fsck}
and @code{bookmark_sync} functions will be called on the bookmarks.
@end table
@item store_path

View file

@ -120,10 +120,6 @@ typedef int (bookmarkfs_backend_sandbox_func) (
struct bookmarkfs_backend_create_resp *resp
);
typedef int (bookmarkfs_backend_sync_func) (
void *backend_ctx
);
typedef int (bookmarkfs_bookmark_create_func) (
void *backend_ctx,
uint64_t parent_id,
@ -222,6 +218,10 @@ typedef int (bookmarkfs_bookmark_set_func) (
size_t val_len
);
typedef int (bookmarkfs_bookmark_sync_func) (
void *backend_ctx
);
typedef void (bookmarkfs_object_free_func) (
void *backend_ctx,
void *object,
@ -235,7 +235,6 @@ struct bookmarkfs_backend {
bookmarkfs_backend_init_func *backend_init;
bookmarkfs_backend_mkfs_func *backend_mkfs;
bookmarkfs_backend_sandbox_func *backend_sandbox;
bookmarkfs_backend_sync_func *backend_sync;
bookmarkfs_bookmark_get_func *bookmark_get;
bookmarkfs_bookmark_list_func *bookmark_list;
@ -247,6 +246,7 @@ struct bookmarkfs_backend {
bookmarkfs_bookmark_permute_func *bookmark_permute;
bookmarkfs_bookmark_rename_func *bookmark_rename;
bookmarkfs_bookmark_set_func *bookmark_set;
bookmarkfs_bookmark_sync_func *bookmark_sync;
bookmarkfs_object_free_func *object_free;
};

View file

@ -2183,16 +2183,6 @@ backend_mkfs (
return status;
}
static int
backend_sync (
void *backend_ctx
) {
struct backend_ctx *ctx = backend_ctx;
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
return store_save(ctx);
}
static int
bookmark_create (
void *backend_ctx,
@ -2698,6 +2688,16 @@ bookmark_set (
return 0;
}
static int
bookmark_sync (
void *backend_ctx
) {
struct backend_ctx *ctx = backend_ctx;
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
return store_save(ctx);
}
#endif /* defined(BOOKMARKFS_BACKEND_CHROMIUM_WRITE) */
BOOKMARKFS_API
@ -2717,12 +2717,12 @@ struct bookmarkfs_backend const bookmarkfs_backend_chromium = {
#ifdef BOOKMARKFS_BACKEND_CHROMIUM_WRITE
.backend_mkfs = backend_mkfs,
.backend_sync = backend_sync,
.bookmark_create = bookmark_create,
.bookmark_delete = bookmark_delete,
.bookmark_permute = bookmark_permute,
.bookmark_rename = bookmark_rename,
.bookmark_set = bookmark_set,
.bookmark_sync = bookmark_sync,
#endif /* defined(BOOKMARKFS_BACKEND_CHROMIUM_WRITE) */
};

View file

@ -3181,16 +3181,6 @@ backend_mkfs (
return status;
}
static int
backend_sync (
void *backend_ctx
) {
struct backend_ctx *ctx = backend_ctx;
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
return store_sync(ctx->db);
}
static int
bookmark_create (
void *backend_ctx,
@ -3598,6 +3588,16 @@ bookmark_set (
return txn_rollback(ctx, status);
}
static int
bookmark_sync (
void *backend_ctx
) {
struct backend_ctx *ctx = backend_ctx;
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
return store_sync(ctx->db);
}
#endif /* defined(BOOKMARKFS_BACKEND_FIREFOX_WRITE) */
BOOKMARKFS_API
@ -3617,12 +3617,12 @@ struct bookmarkfs_backend const bookmarkfs_backend_firefox = {
#ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE
.backend_mkfs = backend_mkfs,
.backend_sync = backend_sync,
.bookmark_create = bookmark_create,
.bookmark_delete = bookmark_delete,
.bookmark_permute = bookmark_permute,
.bookmark_rename = bookmark_rename,
.bookmark_set = bookmark_set,
.bookmark_sync = bookmark_sync,
#endif /* defined(BOOKMARKFS_BACKEND_FIREFOX_WRITE) */
};

View file

@ -1818,7 +1818,7 @@ fs_op_fsync (
goto end;
}
status = ctx.backend_impl->backend_sync(ctx.backend_ctx);
status = ctx.backend_impl->bookmark_sync(ctx.backend_ctx);
end:
send_reply(err, req, -status);
@ -1851,7 +1851,7 @@ fs_op_fsyncdir (
goto end;
}
status = ctx.backend_impl->backend_sync(ctx.backend_ctx);
status = ctx.backend_impl->bookmark_sync(ctx.backend_ctx);
end:
send_reply(err, req, -status);

View file

@ -266,7 +266,7 @@ fsck_control (
if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) {
break;
}
return ctx->backend->backend_sync(ctx->backend_ctx);
return ctx->backend->bookmark_sync(ctx->backend_ctx);
default:
unreachable();