doc: update backend API

Add doc for the `backend_mkfs` function.
This commit is contained in:
CismonX 2025-01-31 00:09:17 +08:00
parent 6cae25ee7f
commit 93ff8cabe9
No known key found for this signature in database
GPG key ID: 3094873E29A482FB

View file

@ -1600,6 +1600,7 @@ Function arguments:
@item conf @item conf
Backend configuration items. Backend configuration items.
@anchor{Backend Configuration}
The @code{bookmarkfs_backend_conf} structure is defined as: The @code{bookmarkfs_backend_conf} structure is defined as:
@example c @example c
@ -1984,6 +1985,54 @@ but the backend may return other error codes which it sees fit.
Also @pxref{Error Codes}. Also @pxref{Error Codes}.
@node Create Bookmark Storage
@subsection Create Bookmark Storage
The @code{backend_mkfs} function is called by the @command{mkfs.bookmarkfs}
program to create a new bookmark storage.
It can be @code{NULL}.
The new bookmark storage should be able to be opened directly, by both
@code{backend_create} and the application that owns the bookmark storage.
Type of the @code{backend_mkfs} function is defined as:
@example c
typedef int (bookmarkfs_backend_mkfs_func) (
struct bookmarkfs_backend_conf const *conf
);
@end example
Function arguments:
@table @code
@item conf
@xref{Backend Configuration} for the definition of the
@code{bookmarkfs_backend_conf} structure.
Some fields should be handled differently from @code{backend_create}:
@table @code
@item flags
A bit array of the following flags:
@table @code
@item BOOKMARKFS_BACKEND_MKFS_FORCE
Indicates that the @option{-o force} option is given to
@command{mkfs.bookmarkfs}.
@end table
@item store_path
Path to the bookmark storage to be created, equivalent to the
@code{store_path} passed to @code{backend_create}.
The backend should not overwrite existing bookmark storage, unless
the @code{BOOKMARKFS_BACKEND_MKFS_FORCE} flag is given.
@end table
@end table
The function should return @t{0} on success, and @t{-1} on error.
@node Filesystem-Check Handlers @node Filesystem-Check Handlers
@chapter Filesystem-Check Handlers @chapter Filesystem-Check Handlers