Filesystem device abstraction layer. More...
Data Structures | |
struct | spdk_fsdev_opts |
fsdev library options More... | |
struct | spdk_fsdev_open_opts |
fsdev device options More... | |
struct | spdk_fsdev_io_opts |
Structure with optional fsdev IO parameters The content of this structure must be valid until the IO is completed. More... | |
struct | spdk_fsdev_file_attr |
struct | spdk_fsdev_file_statfs |
Typedefs | |
typedef void(* | spdk_fsdev_event_cb_t) (enum spdk_fsdev_event_type type, struct spdk_fsdev *fsdev, void *event_ctx) |
Filesystem device event callback. | |
typedef void(* | spdk_fsdev_init_cb) (void *cb_arg, int rc) |
Filesystem device initialization callback. | |
typedef void(* | spdk_fsdev_fini_cb) (void *cb_arg) |
Filesystem device finish callback. | |
typedef void | spdk_fsdev_lookup_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Lookup file operation completion callback. | |
typedef void | spdk_fsdev_forget_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Look up file operation completion callback. | |
typedef void | spdk_fsdev_readlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const char *linkname) |
Read symbolic link operation completion callback. | |
typedef void | spdk_fsdev_symlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a symbolic link operation completion callback. | |
typedef void | spdk_fsdev_mknod_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create file node operation completion callback. | |
typedef void | spdk_fsdev_mkdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a directory operation completion callback. | |
typedef void | spdk_fsdev_unlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove a file operation completion callback. | |
typedef void | spdk_fsdev_rmdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove a directory operation completion callback. | |
typedef void | spdk_fsdev_rename_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Rename a file operation completion callback. | |
typedef void | spdk_fsdev_link_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a hard link operation completion callback. | |
typedef void | spdk_fsdev_statfs_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_statfs *statfs) |
Get file system statistic operation completion callback. | |
typedef void | spdk_fsdev_setxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Set an extended attribute operation completion callback. | |
typedef void | spdk_fsdev_getxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, size_t value_size) |
Get an extended attribute operation completion callback. | |
typedef void | spdk_fsdev_listxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, size_t size, bool size_only) |
List extended attribute names operation completion callback. | |
typedef void | spdk_fsdev_removexattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove an extended attribute operation completion callback. | |
typedef void | spdk_fsdev_fopen_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_handle *fhandle) |
Open a file operation completion callback. | |
typedef void | spdk_fsdev_create_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr, struct spdk_fsdev_file_handle *fhandle) |
Create and open a file operation completion callback. | |
typedef void | spdk_fsdev_release_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Release an open file operation completion callback. | |
typedef void | spdk_fsdev_getattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_attr *attr) |
Get file attributes operation completion callback. | |
typedef void | spdk_fsdev_setattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_attr *attr) |
Set file attributes operation completion callback. | |
typedef void | spdk_fsdev_read_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Read data operation completion callback. | |
typedef void | spdk_fsdev_write_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Write data operation completion callback. | |
typedef void | spdk_fsdev_fsync_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Synchronize file contents operation completion callback. | |
typedef void | spdk_fsdev_flush_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Flush operation completion callback. | |
typedef void | spdk_fsdev_opendir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_handle *fhandle) |
Open a directory operation completion callback. | |
typedef int | spdk_fsdev_readdir_entry_cb(void *cb_arg, struct spdk_io_channel *ch, const char *name, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr, off_t offset) |
Read directory per-entry callback. | |
typedef void | spdk_fsdev_readdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Read directory operation completion callback. | |
typedef void | spdk_fsdev_releasedir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Open a directory operation completion callback. | |
typedef void | spdk_fsdev_fsyncdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Synchronize directory contents operation completion callback. | |
typedef void | spdk_fsdev_flock_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Acquire, modify or release a BSD file lock operation completion callback. | |
typedef void | spdk_fsdev_fallocate_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Allocate requested space operation completion callback. | |
typedef void | spdk_fsdev_copy_file_range_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Copy a range of data from one file to another operation completion callback. | |
typedef void | spdk_fsdev_abort_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
I/O operation abortion completion callback. | |
Enumerations | |
enum | spdk_fsdev_event_type { SPDK_FSDEV_EVENT_REMOVE } |
Asynchronous event type. | |
enum | spdk_fsdev_status { SPDK_FSDEV_STATUS_INVALID , SPDK_FSDEV_STATUS_READY , SPDK_FSDEV_STATUS_UNREGISTERING , SPDK_FSDEV_STATUS_REMOVING } |
fsdev status | |
Functions | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_fsdev_opts)==12, "Incorrect size") | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_fsdev_open_opts)==9, "Incorrect size") | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_fsdev_io_opts)==24, "Incorrect size") | |
void | spdk_fsdev_initialize (spdk_fsdev_init_cb cb_fn, void *cb_arg) |
Initialize filesystem device modules. | |
void | spdk_fsdev_finish (spdk_fsdev_fini_cb cb_fn, void *cb_arg) |
Perform cleanup work to remove the registered filesystem device modules. | |
void | spdk_fsdev_subsystem_config_json (struct spdk_json_write_ctx *w) |
Get the full configuration options for the registered filesystem device modules and created fsdevs. | |
const char * | spdk_fsdev_get_module_name (const struct spdk_fsdev *fsdev) |
Get filesystem device module name. | |
int | spdk_fsdev_open (const char *fsdev_name, spdk_fsdev_event_cb_t event_cb, void *event_ctx, struct spdk_fsdev_open_opts *opts, struct spdk_fsdev_desc **desc) |
Open a filesystem device for I/O operations. | |
void | spdk_fsdev_close (struct spdk_fsdev_desc *desc) |
Close a previously opened filesystem device. | |
const char * | spdk_fsdev_get_name (const struct spdk_fsdev *fsdev) |
Get filesystem device name. | |
struct spdk_fsdev * | spdk_fsdev_desc_get_fsdev (struct spdk_fsdev_desc *desc) |
Get the fsdev associated with a fsdev descriptor. | |
struct spdk_io_channel * | spdk_fsdev_get_io_channel (struct spdk_fsdev_desc *desc) |
Obtain an I/O channel for the filesystem device opened by the specified descriptor. | |
int | spdk_fsdev_set_opts (const struct spdk_fsdev_opts *opts) |
Set the options for the fsdev library. | |
int | spdk_fsdev_get_opts (struct spdk_fsdev_opts *opts, size_t opts_size) |
Get the options for the fsdev library. | |
int | spdk_fsdev_get_memory_domains (struct spdk_fsdev *fsdev, struct spdk_memory_domain **domains, int array_size) |
Get SPDK memory domains used by the given fsdev. | |
int | spdk_fsdev_lookup (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, spdk_fsdev_lookup_cpl_cb cb_fn, void *cb_arg) |
Look up a directory entry by name and get its attributes. | |
int | spdk_fsdev_forget (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, uint64_t nlookup, spdk_fsdev_forget_cpl_cb cb_fn, void *cb_arg) |
Remove file object from internal cache. | |
int | spdk_fsdev_readlink (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, spdk_fsdev_readlink_cpl_cb cb_fn, void *cb_arg) |
Read symbolic link. | |
int | spdk_fsdev_symlink (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *target, const char *linkpath, uid_t euid, gid_t egid, spdk_fsdev_symlink_cpl_cb cb_fn, void *cb_arg) |
Create a symbolic link. | |
int | spdk_fsdev_mknod (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, mode_t mode, dev_t rdev, uid_t euid, gid_t egid, spdk_fsdev_mknod_cpl_cb cb_fn, void *cb_arg) |
Create file node. | |
int | spdk_fsdev_mkdir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, mode_t mode, uid_t euid, gid_t egid, spdk_fsdev_mkdir_cpl_cb cb_fn, void *cb_arg) |
Create a directory. | |
int | spdk_fsdev_unlink (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, spdk_fsdev_unlink_cpl_cb cb_fn, void *cb_arg) |
Remove a file. | |
int | spdk_fsdev_rmdir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, spdk_fsdev_rmdir_cpl_cb cb_fn, void *cb_arg) |
Remove a directory. | |
int | spdk_fsdev_rename (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, struct spdk_fsdev_file_object *new_parent_fobject, const char *new_name, uint32_t flags, spdk_fsdev_rename_cpl_cb cb_fn, void *cb_arg) |
Rename a file. | |
int | spdk_fsdev_link (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_object *new_parent_fobject, const char *name, spdk_fsdev_link_cpl_cb cb_fn, void *cb_arg) |
Create a hard link. | |
int | spdk_fsdev_statfs (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, spdk_fsdev_statfs_cpl_cb cb_fn, void *cb_arg) |
Get file system statistics. | |
int | spdk_fsdev_setxattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, const char *name, const char *value, size_t size, uint32_t flags, spdk_fsdev_setxattr_cpl_cb cb_fn, void *cb_arg) |
Set an extended attribute. | |
int | spdk_fsdev_getxattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, const char *name, void *buffer, size_t size, spdk_fsdev_getxattr_cpl_cb cb_fn, void *cb_arg) |
Get an extended attribute. | |
int | spdk_fsdev_listxattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, char *buffer, size_t size, spdk_fsdev_listxattr_cpl_cb cb_fn, void *cb_arg) |
List extended attribute names. | |
int | spdk_fsdev_removexattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, const char *name, spdk_fsdev_removexattr_cpl_cb cb_fn, void *cb_arg) |
Remove an extended attribute. | |
int | spdk_fsdev_fopen (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, uint32_t flags, spdk_fsdev_fopen_cpl_cb cb_fn, void *cb_arg) |
Open a file. | |
int | spdk_fsdev_create (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *parent_fobject, const char *name, mode_t mode, uint32_t flags, mode_t umask, uid_t euid, gid_t egid, spdk_fsdev_create_cpl_cb cb_fn, void *cb_arg) |
Create and open a file. | |
int | spdk_fsdev_release (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, spdk_fsdev_release_cpl_cb cb_fn, void *cb_arg) |
Release an open file. | |
int | spdk_fsdev_getattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, spdk_fsdev_getattr_cpl_cb cb_fn, void *cb_arg) |
Get file attributes. | |
int | spdk_fsdev_setattr (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, const struct spdk_fsdev_file_attr *attr, uint32_t to_set, spdk_fsdev_setattr_cpl_cb cb_fn, void *cb_arg) |
Set file attributes. | |
int | spdk_fsdev_read (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, size_t size, uint64_t offs, uint32_t flags, struct iovec *iov, uint32_t iovcnt, struct spdk_fsdev_io_opts *opts, spdk_fsdev_read_cpl_cb cb_fn, void *cb_arg) |
Read data. | |
int | spdk_fsdev_write (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, size_t size, uint64_t offs, uint64_t flags, const struct iovec *iov, uint32_t iovcnt, struct spdk_fsdev_io_opts *opts, spdk_fsdev_write_cpl_cb cb_fn, void *cb_arg) |
Write data. | |
int | spdk_fsdev_fsync (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, bool datasync, spdk_fsdev_fsync_cpl_cb cb_fn, void *cb_arg) |
Synchronize file contents. | |
int | spdk_fsdev_flush (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, spdk_fsdev_flush_cpl_cb cb_fn, void *cb_arg) |
Flush. | |
int | spdk_fsdev_opendir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, uint32_t flags, spdk_fsdev_opendir_cpl_cb cb_fn, void *cb_arg) |
Open a directory. | |
int | spdk_fsdev_readdir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, uint64_t offset, spdk_fsdev_readdir_entry_cb entry_cb_fn, spdk_fsdev_readdir_cpl_cb cpl_cb_fn, void *cb_arg) |
Read directory. | |
int | spdk_fsdev_releasedir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, spdk_fsdev_releasedir_cpl_cb cb_fn, void *cb_arg) |
Open a directory. | |
int | spdk_fsdev_fsyncdir (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, bool datasync, spdk_fsdev_fsyncdir_cpl_cb cb_fn, void *cb_arg) |
Synchronize directory contents. | |
int | spdk_fsdev_flock (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, int operation, spdk_fsdev_flock_cpl_cb cb_fn, void *cb_arg) |
Acquire, modify or release a BSD file lock. | |
int | spdk_fsdev_fallocate (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject, struct spdk_fsdev_file_handle *fhandle, int mode, off_t offset, off_t length, spdk_fsdev_fallocate_cpl_cb cb_fn, void *cb_arg) |
Allocate requested space. | |
int | spdk_fsdev_copy_file_range (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, struct spdk_fsdev_file_object *fobject_in, struct spdk_fsdev_file_handle *fhandle_in, off_t off_in, struct spdk_fsdev_file_object *fobject_out, struct spdk_fsdev_file_handle *fhandle_out, off_t off_out, size_t len, uint32_t flags, spdk_fsdev_copy_file_range_cpl_cb cb_fn, void *cb_arg) |
Copy a range of data from one file to another. | |
int | spdk_fsdev_abort (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique_to_abort, spdk_fsdev_abort_cpl_cb cb_fn, void *cb_arg) |
Abort an I/O. | |
Filesystem device abstraction layer.
typedef void spdk_fsdev_abort_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
I/O operation abortion completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_copy_file_range_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Copy a range of data from one file to another operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
data_size | Number of bytes written. |
typedef void spdk_fsdev_create_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr, struct spdk_fsdev_file_handle *fhandle) |
Create and open a file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
fobject | File object. |
attr | File attributes. |
fhandle | File handle. |
typedef void(* spdk_fsdev_event_cb_t) (enum spdk_fsdev_event_type type, struct spdk_fsdev *fsdev, void *event_ctx) |
Filesystem device event callback.
type | Event type. |
fsdev | Filesystem device that triggered event. |
event_ctx | Context for the filesystem device event. |
typedef void spdk_fsdev_fallocate_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Allocate requested space operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void(* spdk_fsdev_fini_cb) (void *cb_arg) |
Filesystem device finish callback.
cb_arg | Callback argument. |
typedef void spdk_fsdev_flock_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Acquire, modify or release a BSD file lock operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_flush_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Flush operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_fopen_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_handle *fhandle) |
Open a file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fhandle | File handle |
typedef void spdk_fsdev_forget_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Look up file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | Operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_fsync_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Synchronize file contents operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_fsyncdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Synchronize directory contents operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_getattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_attr *attr) |
Get file attributes operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | Operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
attr | file attributes. |
typedef void spdk_fsdev_getxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, size_t value_size) |
Get an extended attribute operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
value_size | Size of an data copied to the value buffer. |
typedef void(* spdk_fsdev_init_cb) (void *cb_arg, int rc) |
Filesystem device initialization callback.
cb_arg | Callback argument. |
rc | 0 if filesystem device initialized successfully or negative errno if it failed. |
typedef void spdk_fsdev_link_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a hard link operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fobject | File object. |
attr | File attributes. |
typedef void spdk_fsdev_listxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, size_t size, bool size_only) |
List extended attribute names operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
size | Size of an extended attribute list. |
size_only | true if buffer was NULL or size was 0 upon the spdk_fsdev_listxattr call |
typedef void spdk_fsdev_lookup_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Lookup file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fobject | File object. |
attr | File attributes. |
typedef void spdk_fsdev_mkdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a directory operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fobject | File object. |
attr | File attributes. |
typedef void spdk_fsdev_mknod_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create file node operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fobject | File object. |
attr | File attributes. |
typedef void spdk_fsdev_opendir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_handle *fhandle) |
Open a directory operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fhandle | File handle |
typedef void spdk_fsdev_read_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Read data operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
data_size | Number of bytes read. |
typedef void spdk_fsdev_readdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Read directory operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef int spdk_fsdev_readdir_entry_cb(void *cb_arg, struct spdk_io_channel *ch, const char *name, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr, off_t offset) |
Read directory per-entry callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
name | Name of the entry |
fobject | File object. NULL for "." and "..". |
attr | File attributes. |
offset | Offset of the next entry |
typedef void spdk_fsdev_readlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const char *linkname) |
Read symbolic link operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | Operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
linkname | symbolic link contents |
typedef void spdk_fsdev_release_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Release an open file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_releasedir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Open a directory operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_removexattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove an extended attribute operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_rename_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Rename a file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_rmdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove a directory operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_setattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_attr *attr) |
Set file attributes operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | Operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
attr | file attributes. |
typedef void spdk_fsdev_setxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Set an extended attribute operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_statfs_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_file_statfs *statfs) |
Get file system statistic operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
statfs | filesystem statistics |
typedef void spdk_fsdev_symlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, struct spdk_fsdev_file_object *fobject, const struct spdk_fsdev_file_attr *attr) |
Create a symbolic link operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0. |
fobject | File object. |
attr | File attributes. |
typedef void spdk_fsdev_unlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status) |
Remove a file operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
typedef void spdk_fsdev_write_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, uint32_t data_size) |
Write data operation completion callback.
cb_arg | Context passed to the corresponding spdk_fsdev_ API |
ch | I/O channel. |
status | operation result. 0 if the operation succeeded, an error code otherwise. |
data_size | Number of bytes written. |
int spdk_fsdev_abort | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique_to_abort, | ||
spdk_fsdev_abort_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Abort an I/O.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique_to_abort | Unique I/O id of the IO to abort. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
void spdk_fsdev_close | ( | struct spdk_fsdev_desc * | desc | ) |
Close a previously opened filesystem device.
Must be called on the same thread that the spdk_fsdev_open() was performed on.
desc | Filesystem device descriptor to close. |
int spdk_fsdev_copy_file_range | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject_in, | ||
struct spdk_fsdev_file_handle * | fhandle_in, | ||
off_t | off_in, | ||
struct spdk_fsdev_file_object * | fobject_out, | ||
struct spdk_fsdev_file_handle * | fhandle_out, | ||
off_t | off_out, | ||
size_t | len, | ||
uint32_t | flags, | ||
spdk_fsdev_copy_file_range_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Copy a range of data from one file to another.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject_in | IN File object. |
fhandle_in | IN File handle. |
off_in | Starting point from were the data should be read. |
fobject_out | OUT File object. |
fhandle_out | OUT File handle. |
off_out | Starting point from were the data should be written. |
len | Maximum size of the data to copy. |
flags | Operation flags, see the copy_file_range() |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_create | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
mode_t | mode, | ||
uint32_t | flags, | ||
mode_t | umask, | ||
uid_t | euid, | ||
gid_t | egid, | ||
spdk_fsdev_create_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Create and open a file.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
name | Name to create. |
mode | File type and mode with which to create the new file. |
flags | Operation flags. |
umask | Umask of the calling process. |
euid | Effective user ID of the calling process. |
egid | Effective group ID of the calling process. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
struct spdk_fsdev * spdk_fsdev_desc_get_fsdev | ( | struct spdk_fsdev_desc * | desc | ) |
Get the fsdev associated with a fsdev descriptor.
desc | Open filesystem device descriptor |
int spdk_fsdev_fallocate | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
int | mode, | ||
off_t | offset, | ||
off_t | length, | ||
spdk_fsdev_fallocate_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Allocate requested space.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object.. |
fhandle | File handle. |
mode | determines the operation to be performed on the given range, see fallocate(2) |
offset | starting point for allocated region. |
length | size of allocated region. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
void spdk_fsdev_finish | ( | spdk_fsdev_fini_cb | cb_fn, |
void * | cb_arg ) |
Perform cleanup work to remove the registered filesystem device modules.
cb_fn | Called when the removal is complete. |
cb_arg | Argument passed to function cb_fn. |
int spdk_fsdev_flock | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
int | operation, | ||
spdk_fsdev_flock_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Acquire, modify or release a BSD file lock.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object.. |
fhandle | File handle. |
operation | Lock operation (see man flock, LOCK_NB will always be added). |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_flush | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
spdk_fsdev_flush_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Flush.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_fopen | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
uint32_t | flags, | ||
spdk_fsdev_fopen_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Open a file.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
flags | Operation flags. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_forget | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
uint64_t | nlookup, | ||
spdk_fsdev_forget_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Remove file object from internal cache.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
nlookup | Number of lookups to forget. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_fsync | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
bool | datasync, | ||
spdk_fsdev_fsync_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Synchronize file contents.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle. |
datasync | Flag indicating if only data should be flushed. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_fsyncdir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
bool | datasync, | ||
spdk_fsdev_fsyncdir_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Synchronize directory contents.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle |
datasync | Flag indicating if only data should be flushed. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
struct spdk_io_channel * spdk_fsdev_get_io_channel | ( | struct spdk_fsdev_desc * | desc | ) |
Obtain an I/O channel for the filesystem device opened by the specified descriptor.
I/O channels are bound to threads, so the resulting I/O channel may only be used from the thread it was originally obtained from.
desc | Filesystem device descriptor. |
int spdk_fsdev_get_memory_domains | ( | struct spdk_fsdev * | fsdev, |
struct spdk_memory_domain ** | domains, | ||
int | array_size ) |
Get SPDK memory domains used by the given fsdev.
If fsdev reports that it uses memory domains that means that it can work with data buffers located in those memory domains.
The user can call this function with domains set to NULL and array_size set to 0 to get the number of memory domains used by fsdev
fsdev | filesystem device |
domains | pointer to an array of memory domains to be filled by this function. The user should allocate big enough array to keep all memory domains used by fsdev and all underlying fsdevs |
array_size | size of domains array |
const char * spdk_fsdev_get_module_name | ( | const struct spdk_fsdev * | fsdev | ) |
Get filesystem device module name.
fsdev | Filesystem device to query. |
const char * spdk_fsdev_get_name | ( | const struct spdk_fsdev * | fsdev | ) |
Get filesystem device name.
fsdev | filesystem device to query. |
int spdk_fsdev_get_opts | ( | struct spdk_fsdev_opts * | opts, |
size_t | opts_size ) |
Get the options for the fsdev library.
opts | Output parameter for options. |
opts_size | sizeof(*opts) |
int spdk_fsdev_getattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
spdk_fsdev_getattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Get file attributes.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_getxattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
const char * | name, | ||
void * | buffer, | ||
size_t | size, | ||
spdk_fsdev_getxattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Get an extended attribute.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
name | Name of an extended attribute. |
buffer | Buffer to put the extended attribute's value. |
size | Size of value's buffer. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
void spdk_fsdev_initialize | ( | spdk_fsdev_init_cb | cb_fn, |
void * | cb_arg ) |
Initialize filesystem device modules.
cb_fn | Called when the initialization is complete. |
cb_arg | Argument passed to function cb_fn. |
int spdk_fsdev_link | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_object * | new_parent_fobject, | ||
const char * | name, | ||
spdk_fsdev_link_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Create a hard link.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
new_parent_fobject | New parent directory. |
name | Link name. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_listxattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
char * | buffer, | ||
size_t | size, | ||
spdk_fsdev_listxattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
List extended attribute names.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
buffer | Buffer to to be used for the attribute names. |
size | Size of the buffer. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_lookup | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
spdk_fsdev_lookup_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Look up a directory entry by name and get its attributes.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory. NULL for the root directory. |
name | The name to look up. Ignored if parent_fobject is NULL. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_mkdir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
mode_t | mode, | ||
uid_t | euid, | ||
gid_t | egid, | ||
spdk_fsdev_mkdir_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Create a directory.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
name | Directory name to create. |
mode | Directory type and mode with which to create the new directory. |
euid | Effective user ID of the calling process. |
egid | Effective group ID of the calling process. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_mknod | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
mode_t | mode, | ||
dev_t | rdev, | ||
uid_t | euid, | ||
gid_t | egid, | ||
spdk_fsdev_mknod_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Create file node.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
name | File name to create. |
mode | File type and mode with which to create the new file. |
rdev | The device number (only valid if created file is a device) |
euid | Effective user ID of the calling process. |
egid | Effective group ID of the calling process. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_open | ( | const char * | fsdev_name, |
spdk_fsdev_event_cb_t | event_cb, | ||
void * | event_ctx, | ||
struct spdk_fsdev_open_opts * | opts, | ||
struct spdk_fsdev_desc ** | desc ) |
Open a filesystem device for I/O operations.
fsdev_name | Filesystem device name to open. |
event_cb | notification callback to be called when the fsdev triggers asynchronous event such as fsdev removal. This will always be called on the same thread that spdk_fsdev_open() was called on. In case of removal event the descriptor will have to be manually closed to make the fsdev unregister proceed. |
event_ctx | param for event_cb. |
opts | optional open opts. |
desc | output parameter for the descriptor when operation is successful |
int spdk_fsdev_opendir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
uint32_t | flags, | ||
spdk_fsdev_opendir_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Open a directory.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
flags | Operation flags. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_read | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
size_t | size, | ||
uint64_t | offs, | ||
uint32_t | flags, | ||
struct iovec * | iov, | ||
uint32_t | iovcnt, | ||
struct spdk_fsdev_io_opts * | opts, | ||
spdk_fsdev_read_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Read data.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle. |
size | Number of bytes to read. |
offs | Offset to read from. |
flags | Operation flags. |
iov | Array of iovec to be used for the data. |
iovcnt | Size of the iov array. |
opts | Optional structure with extended File Operation options. If set, this structure must be valid until the operation is completed. size member of this structure is used for ABI compatibility and must be set to sizeof(struct spdk_fsdev_io_opts). |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_readdir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
uint64_t | offset, | ||
spdk_fsdev_readdir_entry_cb | entry_cb_fn, | ||
spdk_fsdev_readdir_cpl_cb | cpl_cb_fn, | ||
void * | cb_arg ) |
Read directory.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle |
offset | Offset to continue reading the directory stream |
entry_cb_fn | Per-entry callback. |
cpl_cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_readlink | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
spdk_fsdev_readlink_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Read symbolic link.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_release | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
spdk_fsdev_release_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Release an open file.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_releasedir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
spdk_fsdev_releasedir_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Open a directory.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_removexattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
const char * | name, | ||
spdk_fsdev_removexattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Remove an extended attribute.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
name | Name of an extended attribute. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_rename | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
struct spdk_fsdev_file_object * | new_parent_fobject, | ||
const char * | new_name, | ||
uint32_t | flags, | ||
spdk_fsdev_rename_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Rename a file.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory. |
name | Old rename. |
new_parent_fobject | New parent directory. |
new_name | New name. |
flags | Operation flags. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_rmdir | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
spdk_fsdev_rmdir_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Remove a directory.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
name | Name to remove. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_set_opts | ( | const struct spdk_fsdev_opts * | opts | ) |
Set the options for the fsdev library.
opts | options to set |
int spdk_fsdev_setattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
const struct spdk_fsdev_file_attr * | attr, | ||
uint32_t | to_set, | ||
spdk_fsdev_setattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Set file attributes.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle |
attr | file attributes to set. |
to_set | Bit mask of attributes which should be set. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_setxattr | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
const char * | name, | ||
const char * | value, | ||
size_t | size, | ||
uint32_t | flags, | ||
spdk_fsdev_setxattr_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Set an extended attribute.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
name | Name of an extended attribute. |
value | Buffer that contains value of an extended attribute. |
size | Size of an extended attribute. |
flags | Operation flags. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_statfs | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
spdk_fsdev_statfs_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Get file system statistics.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
void spdk_fsdev_subsystem_config_json | ( | struct spdk_json_write_ctx * | w | ) |
Get the full configuration options for the registered filesystem device modules and created fsdevs.
w | pointer to a JSON write context where the configuration will be written. |
int spdk_fsdev_symlink | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | target, | ||
const char * | linkpath, | ||
uid_t | euid, | ||
gid_t | egid, | ||
spdk_fsdev_symlink_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Create a symbolic link.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
target | symbolic link's content |
linkpath | symbolic link's name |
euid | Effective user ID of the calling process. |
egid | Effective group ID of the calling process. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_unlink | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | parent_fobject, | ||
const char * | name, | ||
spdk_fsdev_unlink_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Remove a file.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
parent_fobject | Parent directory |
name | Name to remove. |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |
int spdk_fsdev_write | ( | struct spdk_fsdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | unique, | ||
struct spdk_fsdev_file_object * | fobject, | ||
struct spdk_fsdev_file_handle * | fhandle, | ||
size_t | size, | ||
uint64_t | offs, | ||
uint64_t | flags, | ||
const struct iovec * | iov, | ||
uint32_t | iovcnt, | ||
struct spdk_fsdev_io_opts * | opts, | ||
spdk_fsdev_write_cpl_cb | cb_fn, | ||
void * | cb_arg ) |
Write data.
desc | Filesystem device descriptor. |
ch | I/O channel. |
unique | Unique I/O id. |
fobject | File object. |
fhandle | File handle. |
size | Number of bytes to write. |
offs | Offset to write to. |
flags | Operation flags. |
iov | Array of iovec to where the data is stored. |
iovcnt | Size of the iov array. |
opts | Optional structure with extended File Operation options. If set, this structure must be valid until the operation is completed. size member of this structure is used for ABI compatibility and must be set to sizeof(struct spdk_fsdev_io_opts). |
cb_fn | Completion callback. |
cb_arg | Context to be passed to the completion callback. |