mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
backend: rename backend_sync -> bookmark_sync
This commit is contained in:
parent
bff21c54b1
commit
10ad224b03
6 changed files with 39 additions and 39 deletions
|
@ -1404,11 +1404,10 @@ struct bookmarkfs_backend @{
|
||||||
bookmarkfs_backend_init_func *backend_init;
|
bookmarkfs_backend_init_func *backend_init;
|
||||||
bookmarkfs_backend_mkfs_func *backend_mkfs;
|
bookmarkfs_backend_mkfs_func *backend_mkfs;
|
||||||
bookmarkfs_backend_sandbox_func *backend_sandbox;
|
bookmarkfs_backend_sandbox_func *backend_sandbox;
|
||||||
bookmarkfs_backend_sync_func *backend_sync;
|
|
||||||
|
|
||||||
bookmarkfs_bookmark_get_func *bookmark_get;
|
bookmarkfs_bookmark_get_func *bookmark_get;
|
||||||
bookmarkfs_bookmark_list_func *bookmark_list;
|
bookmarkfs_bookmark_list_func *bookmark_list;
|
||||||
bookmarkfs_bookmark_lookup_func *bookmark_lookup;
|
bookmarkfs_bookmark_lookup_func *bookmark_lookup;
|
||||||
|
|
||||||
bookmarkfs_bookmark_create_func *bookmark_create;
|
bookmarkfs_bookmark_create_func *bookmark_create;
|
||||||
bookmarkfs_bookmark_delete_func *bookmark_delete;
|
bookmarkfs_bookmark_delete_func *bookmark_delete;
|
||||||
|
@ -1416,6 +1415,7 @@ struct bookmarkfs_backend @{
|
||||||
bookmarkfs_bookmark_permute_func *bookmark_permute;
|
bookmarkfs_bookmark_permute_func *bookmark_permute;
|
||||||
bookmarkfs_bookmark_rename_func *bookmark_rename;
|
bookmarkfs_bookmark_rename_func *bookmark_rename;
|
||||||
bookmarkfs_bookmark_set_func *bookmark_set;
|
bookmarkfs_bookmark_set_func *bookmark_set;
|
||||||
|
bookmarkfs_bookmark_sync_func *bookmark_sync;
|
||||||
|
|
||||||
bookmarkfs_object_free_func *object_free;
|
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}.
|
Indicates that the backend is launched from @command{fsck.bookmarkfs}.
|
||||||
|
|
||||||
The backend must claim exclusive access to the bookmark storage, and only
|
The backend must claim exclusive access to the bookmark storage, and only
|
||||||
the @code{bookmark_lookup}, @code{bookmark_list} and @code{bookmark_fsck}
|
the @code{bookmark_lookup}, @code{bookmark_list}, @code{bookmark_fsck}
|
||||||
functions will be called on the bookmarks.
|
and @code{bookmark_sync} functions will be called on the bookmarks.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item store_path
|
@item store_path
|
||||||
|
|
|
@ -120,10 +120,6 @@ typedef int (bookmarkfs_backend_sandbox_func) (
|
||||||
struct bookmarkfs_backend_create_resp *resp
|
struct bookmarkfs_backend_create_resp *resp
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef int (bookmarkfs_backend_sync_func) (
|
|
||||||
void *backend_ctx
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef int (bookmarkfs_bookmark_create_func) (
|
typedef int (bookmarkfs_bookmark_create_func) (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
uint64_t parent_id,
|
uint64_t parent_id,
|
||||||
|
@ -222,6 +218,10 @@ typedef int (bookmarkfs_bookmark_set_func) (
|
||||||
size_t val_len
|
size_t val_len
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef int (bookmarkfs_bookmark_sync_func) (
|
||||||
|
void *backend_ctx
|
||||||
|
);
|
||||||
|
|
||||||
typedef void (bookmarkfs_object_free_func) (
|
typedef void (bookmarkfs_object_free_func) (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
void *object,
|
void *object,
|
||||||
|
@ -235,11 +235,10 @@ struct bookmarkfs_backend {
|
||||||
bookmarkfs_backend_init_func *backend_init;
|
bookmarkfs_backend_init_func *backend_init;
|
||||||
bookmarkfs_backend_mkfs_func *backend_mkfs;
|
bookmarkfs_backend_mkfs_func *backend_mkfs;
|
||||||
bookmarkfs_backend_sandbox_func *backend_sandbox;
|
bookmarkfs_backend_sandbox_func *backend_sandbox;
|
||||||
bookmarkfs_backend_sync_func *backend_sync;
|
|
||||||
|
|
||||||
bookmarkfs_bookmark_get_func *bookmark_get;
|
bookmarkfs_bookmark_get_func *bookmark_get;
|
||||||
bookmarkfs_bookmark_list_func *bookmark_list;
|
bookmarkfs_bookmark_list_func *bookmark_list;
|
||||||
bookmarkfs_bookmark_lookup_func *bookmark_lookup;
|
bookmarkfs_bookmark_lookup_func *bookmark_lookup;
|
||||||
|
|
||||||
bookmarkfs_bookmark_create_func *bookmark_create;
|
bookmarkfs_bookmark_create_func *bookmark_create;
|
||||||
bookmarkfs_bookmark_delete_func *bookmark_delete;
|
bookmarkfs_bookmark_delete_func *bookmark_delete;
|
||||||
|
@ -247,6 +246,7 @@ struct bookmarkfs_backend {
|
||||||
bookmarkfs_bookmark_permute_func *bookmark_permute;
|
bookmarkfs_bookmark_permute_func *bookmark_permute;
|
||||||
bookmarkfs_bookmark_rename_func *bookmark_rename;
|
bookmarkfs_bookmark_rename_func *bookmark_rename;
|
||||||
bookmarkfs_bookmark_set_func *bookmark_set;
|
bookmarkfs_bookmark_set_func *bookmark_set;
|
||||||
|
bookmarkfs_bookmark_sync_func *bookmark_sync;
|
||||||
|
|
||||||
bookmarkfs_object_free_func *object_free;
|
bookmarkfs_object_free_func *object_free;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2183,16 +2183,6 @@ backend_mkfs (
|
||||||
return status;
|
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
|
static int
|
||||||
bookmark_create (
|
bookmark_create (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
|
@ -2698,6 +2688,16 @@ bookmark_set (
|
||||||
return 0;
|
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) */
|
#endif /* defined(BOOKMARKFS_BACKEND_CHROMIUM_WRITE) */
|
||||||
|
|
||||||
BOOKMARKFS_API
|
BOOKMARKFS_API
|
||||||
|
@ -2717,12 +2717,12 @@ struct bookmarkfs_backend const bookmarkfs_backend_chromium = {
|
||||||
|
|
||||||
#ifdef BOOKMARKFS_BACKEND_CHROMIUM_WRITE
|
#ifdef BOOKMARKFS_BACKEND_CHROMIUM_WRITE
|
||||||
.backend_mkfs = backend_mkfs,
|
.backend_mkfs = backend_mkfs,
|
||||||
.backend_sync = backend_sync,
|
|
||||||
|
|
||||||
.bookmark_create = bookmark_create,
|
.bookmark_create = bookmark_create,
|
||||||
.bookmark_delete = bookmark_delete,
|
.bookmark_delete = bookmark_delete,
|
||||||
.bookmark_permute = bookmark_permute,
|
.bookmark_permute = bookmark_permute,
|
||||||
.bookmark_rename = bookmark_rename,
|
.bookmark_rename = bookmark_rename,
|
||||||
.bookmark_set = bookmark_set,
|
.bookmark_set = bookmark_set,
|
||||||
|
.bookmark_sync = bookmark_sync,
|
||||||
#endif /* defined(BOOKMARKFS_BACKEND_CHROMIUM_WRITE) */
|
#endif /* defined(BOOKMARKFS_BACKEND_CHROMIUM_WRITE) */
|
||||||
};
|
};
|
||||||
|
|
|
@ -3181,16 +3181,6 @@ backend_mkfs (
|
||||||
return status;
|
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
|
static int
|
||||||
bookmark_create (
|
bookmark_create (
|
||||||
void *backend_ctx,
|
void *backend_ctx,
|
||||||
|
@ -3598,6 +3588,16 @@ bookmark_set (
|
||||||
return txn_rollback(ctx, status);
|
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) */
|
#endif /* defined(BOOKMARKFS_BACKEND_FIREFOX_WRITE) */
|
||||||
|
|
||||||
BOOKMARKFS_API
|
BOOKMARKFS_API
|
||||||
|
@ -3617,12 +3617,12 @@ struct bookmarkfs_backend const bookmarkfs_backend_firefox = {
|
||||||
|
|
||||||
#ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE
|
#ifdef BOOKMARKFS_BACKEND_FIREFOX_WRITE
|
||||||
.backend_mkfs = backend_mkfs,
|
.backend_mkfs = backend_mkfs,
|
||||||
.backend_sync = backend_sync,
|
|
||||||
|
|
||||||
.bookmark_create = bookmark_create,
|
.bookmark_create = bookmark_create,
|
||||||
.bookmark_delete = bookmark_delete,
|
.bookmark_delete = bookmark_delete,
|
||||||
.bookmark_permute = bookmark_permute,
|
.bookmark_permute = bookmark_permute,
|
||||||
.bookmark_rename = bookmark_rename,
|
.bookmark_rename = bookmark_rename,
|
||||||
.bookmark_set = bookmark_set,
|
.bookmark_set = bookmark_set,
|
||||||
|
.bookmark_sync = bookmark_sync,
|
||||||
#endif /* defined(BOOKMARKFS_BACKEND_FIREFOX_WRITE) */
|
#endif /* defined(BOOKMARKFS_BACKEND_FIREFOX_WRITE) */
|
||||||
};
|
};
|
||||||
|
|
|
@ -1818,7 +1818,7 @@ fs_op_fsync (
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ctx.backend_impl->backend_sync(ctx.backend_ctx);
|
status = ctx.backend_impl->bookmark_sync(ctx.backend_ctx);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
send_reply(err, req, -status);
|
send_reply(err, req, -status);
|
||||||
|
@ -1851,7 +1851,7 @@ fs_op_fsyncdir (
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ctx.backend_impl->backend_sync(ctx.backend_ctx);
|
status = ctx.backend_impl->bookmark_sync(ctx.backend_ctx);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
send_reply(err, req, -status);
|
send_reply(err, req, -status);
|
||||||
|
|
|
@ -266,7 +266,7 @@ fsck_control (
|
||||||
if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) {
|
if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ctx->backend->backend_sync(ctx->backend_ctx);
|
return ctx->backend->bookmark_sync(ctx->backend_ctx);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
unreachable();
|
unreachable();
|
||||||
|
|
Loading…
Add table
Reference in a new issue