Loading...
Searching...
No Matches
fsdev.h File Reference

Filesystem device abstraction layer. More...

Data Structures

struct  spdk_fsdev_opts
 fsdev library options More...
 
struct  spdk_fsdev_mount_opts
 fsdev mount 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
 

Macros

#define FSDEV_SET_ATTR_MODE   (1 << 0)
 
#define FSDEV_SET_ATTR_UID   (1 << 1)
 
#define FSDEV_SET_ATTR_GID   (1 << 2)
 
#define FSDEV_SET_ATTR_SIZE   (1 << 3)
 
#define FSDEV_SET_ATTR_ATIME   (1 << 4)
 
#define FSDEV_SET_ATTR_MTIME   (1 << 5)
 
#define FSDEV_SET_ATTR_ATIME_NOW   (1 << 6)
 
#define FSDEV_SET_ATTR_MTIME_NOW   (1 << 7)
 
#define FSDEV_SET_ATTR_CTIME   (1 << 8)
 

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_mount_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_mount_opts *opts, struct spdk_fsdev_file_object *root_fobject)
 Mount operation completion callback.
 
typedef void spdk_fsdev_umount_cpl_cb(void *cb_arg, struct spdk_io_channel *ch)
 Umount operation completion 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_mount_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_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_fsdevspdk_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_mount (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, const struct spdk_fsdev_mount_opts *opts, spdk_fsdev_mount_cpl_cb cb_fn, void *cb_arg)
 Mount the filesystem.
 
int spdk_fsdev_umount (struct spdk_fsdev_desc *desc, struct spdk_io_channel *ch, uint64_t unique, spdk_fsdev_umount_cpl_cb cb_fn, void *cb_arg)
 Unmount the filesystem.
 
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.
 

Detailed Description

Filesystem device abstraction layer.

Typedef Documentation

◆ spdk_fsdev_abort_cpl_cb

typedef void spdk_fsdev_abort_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

I/O operation abortion completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_copy_file_range_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.
data_sizeNumber of bytes written.

◆ spdk_fsdev_create_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.
fobjectFile object.
attrFile attributes.
fhandleFile handle.

◆ spdk_fsdev_event_cb_t

typedef void(* spdk_fsdev_event_cb_t) (enum spdk_fsdev_event_type type, struct spdk_fsdev *fsdev, void *event_ctx)

Filesystem device event callback.

Parameters
typeEvent type.
fsdevFilesystem device that triggered event.
event_ctxContext for the filesystem device event.

◆ spdk_fsdev_fallocate_cpl_cb

typedef void spdk_fsdev_fallocate_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Allocate requested space operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_fini_cb

typedef void(* spdk_fsdev_fini_cb) (void *cb_arg)

Filesystem device finish callback.

Parameters
cb_argCallback argument.

◆ spdk_fsdev_flock_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_flush_cpl_cb

typedef void spdk_fsdev_flush_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Flush operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_fopen_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fhandleFile handle

◆ spdk_fsdev_forget_cpl_cb

typedef void spdk_fsdev_forget_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Look up file operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusOperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_fsync_cpl_cb

typedef void spdk_fsdev_fsync_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Synchronize file contents operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_fsyncdir_cpl_cb

typedef void spdk_fsdev_fsyncdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Synchronize directory contents operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_getattr_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusOperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
attrfile attributes.

◆ spdk_fsdev_getxattr_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
value_sizeSize of an data copied to the value buffer.

◆ spdk_fsdev_init_cb

typedef void(* spdk_fsdev_init_cb) (void *cb_arg, int rc)

Filesystem device initialization callback.

Parameters
cb_argCallback argument.
rc0 if filesystem device initialized successfully or negative errno if it failed.

◆ spdk_fsdev_link_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fobjectFile object.
attrFile attributes.

◆ spdk_fsdev_listxattr_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
sizeSize of an extended attribute list.
size_onlytrue if buffer was NULL or size was 0 upon the spdk_fsdev_listxattr call

◆ spdk_fsdev_lookup_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fobjectFile object.
attrFile attributes.

◆ spdk_fsdev_mkdir_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fobjectFile object.
attrFile attributes.

◆ spdk_fsdev_mknod_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fobjectFile object.
attrFile attributes.

◆ spdk_fsdev_mount_cpl_cb

typedef void spdk_fsdev_mount_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status, const struct spdk_fsdev_mount_opts *opts, struct spdk_fsdev_file_object *root_fobject)

Mount operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusOperation status, 0 on success or error code otherwise.
optsResult options.
root_fobjectRoot file object

◆ spdk_fsdev_opendir_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fhandleFile handle

◆ spdk_fsdev_read_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.
data_sizeNumber of bytes read.

◆ spdk_fsdev_readdir_cpl_cb

typedef void spdk_fsdev_readdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Read directory operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_readdir_entry_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
nameName of the entry
fobjectFile object. NULL for "." and "..".
attrFile attributes.
offsetOffset of the next entry
Returns
0 to continue the enumeration, an error code otherwise.

◆ spdk_fsdev_readlink_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusOperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
linknamesymbolic link contents

◆ spdk_fsdev_release_cpl_cb

typedef void spdk_fsdev_release_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Release an open file operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_releasedir_cpl_cb

typedef void spdk_fsdev_releasedir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Open a directory operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_removexattr_cpl_cb

typedef void spdk_fsdev_removexattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Remove an extended attribute operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_rename_cpl_cb

typedef void spdk_fsdev_rename_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Rename a file operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_rmdir_cpl_cb

typedef void spdk_fsdev_rmdir_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Remove a directory operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_setattr_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusOperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
attrfile attributes.

◆ spdk_fsdev_setxattr_cpl_cb

typedef void spdk_fsdev_setxattr_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Set an extended attribute operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_statfs_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
statfsfilesystem statistics

◆ spdk_fsdev_symlink_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise. Following parameters should be ignored if status != 0.
fobjectFile object.
attrFile attributes.

◆ spdk_fsdev_umount_cpl_cb

typedef void spdk_fsdev_umount_cpl_cb(void *cb_arg, struct spdk_io_channel *ch)

Umount operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.

◆ spdk_fsdev_unlink_cpl_cb

typedef void spdk_fsdev_unlink_cpl_cb(void *cb_arg, struct spdk_io_channel *ch, int status)

Remove a file operation completion callback.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.

◆ spdk_fsdev_write_cpl_cb

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.

Parameters
cb_argContext passed to the corresponding spdk_fsdev_ API
chI/O channel.
statusoperation result. 0 if the operation succeeded, an error code otherwise.
data_sizeNumber of bytes written.

Function Documentation

◆ spdk_fsdev_abort()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
unique_to_abortUnique I/O id of the IO to abort.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_close()

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.

Parameters
descFilesystem device descriptor to close.

◆ spdk_fsdev_copy_file_range()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobject_inIN File object.
fhandle_inIN File handle.
off_inStarting point from were the data should be read.
fobject_outOUT File object.
fhandle_outOUT File handle.
off_outStarting point from were the data should be written.
lenMaximum size of the data to copy.
flagsOperation flags, see the copy_file_range()
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_create()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
nameName to create.
modeFile type and mode with which to create the new file.
flagsOperation flags.
umaskUmask of the calling process.
euidEffective user ID of the calling process.
egidEffective group ID of the calling process.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_desc_get_fsdev()

struct spdk_fsdev * spdk_fsdev_desc_get_fsdev ( struct spdk_fsdev_desc * desc)

Get the fsdev associated with a fsdev descriptor.

Parameters
descOpen filesystem device descriptor
Returns
fsdev associated with the descriptor

◆ spdk_fsdev_fallocate()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object..
fhandleFile handle.
modedetermines the operation to be performed on the given range, see fallocate(2)
offsetstarting point for allocated region.
lengthsize of allocated region.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_finish()

void spdk_fsdev_finish ( spdk_fsdev_fini_cb cb_fn,
void * cb_arg )

Perform cleanup work to remove the registered filesystem device modules.

Parameters
cb_fnCalled when the removal is complete.
cb_argArgument passed to function cb_fn.

◆ spdk_fsdev_flock()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object..
fhandleFile handle.
operationLock operation (see man flock, LOCK_NB will always be added).
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_flush()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_fopen()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
flagsOperation flags.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_forget()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
nlookupNumber of lookups to forget.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_fsync()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle.
datasyncFlag indicating if only data should be flushed.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_fsyncdir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle
datasyncFlag indicating if only data should be flushed.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_get_io_channel()

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.

Parameters
descFilesystem device descriptor.
Returns
A handle to the I/O channel or NULL on failure.

◆ spdk_fsdev_get_memory_domains()

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

Parameters
fsdevfilesystem device
domainspointer 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_sizesize of domains array
Returns
the number of entries in domains array or negated errno. If returned value is bigger than array_size passed by the user then the user should increase the size of domains array and call this function again. There is no guarantees that the content of domains array is valid in that case. -EINVAL if input parameters were invalid

◆ spdk_fsdev_get_module_name()

const char * spdk_fsdev_get_module_name ( const struct spdk_fsdev * fsdev)

Get filesystem device module name.

Parameters
fsdevFilesystem device to query.
Returns
Name of fsdev module as a null-terminated string.

◆ spdk_fsdev_get_name()

const char * spdk_fsdev_get_name ( const struct spdk_fsdev * fsdev)

Get filesystem device name.

Parameters
fsdevfilesystem device to query.
Returns
Name of fsdev as a null-terminated string.

◆ spdk_fsdev_get_opts()

int spdk_fsdev_get_opts ( struct spdk_fsdev_opts * opts,
size_t opts_size )

Get the options for the fsdev library.

Parameters
optsOutput parameter for options.
opts_sizesizeof(*opts)

◆ spdk_fsdev_getattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_getxattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
nameName of an extended attribute.
bufferBuffer to put the extended attribute's value.
sizeSize of value's buffer.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_initialize()

void spdk_fsdev_initialize ( spdk_fsdev_init_cb cb_fn,
void * cb_arg )

Initialize filesystem device modules.

Parameters
cb_fnCalled when the initialization is complete.
cb_argArgument passed to function cb_fn.

◆ spdk_fsdev_link()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
new_parent_fobjectNew parent directory.
nameLink name.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_listxattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
bufferBuffer to to be used for the attribute names.
sizeSize of the buffer.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_lookup()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory. NULL for the root directory.
nameThe name to look up. Ignored if parent_fobject is NULL.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_mkdir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
nameDirectory name to create.
modeDirectory type and mode with which to create the new directory.
euidEffective user ID of the calling process.
egidEffective group ID of the calling process.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_mknod()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
nameFile name to create.
modeFile type and mode with which to create the new file.
rdevThe device number (only valid if created file is a device)
euidEffective user ID of the calling process.
egidEffective group ID of the calling process.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_mount()

int spdk_fsdev_mount ( struct spdk_fsdev_desc * desc,
struct spdk_io_channel * ch,
uint64_t unique,
const struct spdk_fsdev_mount_opts * opts,
spdk_fsdev_mount_cpl_cb cb_fn,
void * cb_arg )

Mount the filesystem.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
optsRequested options.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called.

Note: the opts are the subject of negotiation. An API user provides a desired opts here and gets a result opts in the cb_fn. The result opts are filled by the underlying fsdev module which may agree or reduce (but not expand) the desired features set.

◆ spdk_fsdev_open()

int spdk_fsdev_open ( const char * fsdev_name,
spdk_fsdev_event_cb_t event_cb,
void * event_ctx,
struct spdk_fsdev_desc ** desc )

Open a filesystem device for I/O operations.

Parameters
fsdev_nameFilesystem device name to open.
event_cbnotification 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_ctxparam for event_cb.
descoutput parameter for the descriptor when operation is successful
Returns
0 if operation is successful, suitable errno value otherwise

◆ spdk_fsdev_opendir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
flagsOperation flags.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_read()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle.
sizeNumber of bytes to read.
offsOffset to read from.
flagsOperation flags.
iovArray of iovec to be used for the data.
iovcntSize of the iov array.
optsOptional 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_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_readdir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle
offsetOffset to continue reading the directory stream
entry_cb_fnPer-entry callback.
cpl_cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_readlink()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_release()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_releasedir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_removexattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
nameName of an extended attribute.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_rename()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory.
nameOld rename.
new_parent_fobjectNew parent directory.
new_nameNew name.
flagsOperation flags.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_rmdir()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
nameName to remove.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_set_opts()

int spdk_fsdev_set_opts ( const struct spdk_fsdev_opts * opts)

Set the options for the fsdev library.

Parameters
optsoptions to set
Returns
0 on success.
-EINVAL if the options are invalid.

◆ spdk_fsdev_setattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle
attrfile attributes to set.
to_setBit mask of attributes which should be set.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_setxattr()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
nameName of an extended attribute.
valueBuffer that contains value of an extended attribute.
sizeSize of an extended attribute.
flagsOperation flags.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_statfs()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects

◆ spdk_fsdev_subsystem_config_json()

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.

Parameters
wpointer to a JSON write context where the configuration will be written.

◆ spdk_fsdev_symlink()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
targetsymbolic link's content
linkpathsymbolic link's name
euidEffective user ID of the calling process.
egidEffective group ID of the calling process.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_umount()

int spdk_fsdev_umount ( struct spdk_fsdev_desc * desc,
struct spdk_io_channel * ch,
uint64_t unique,
spdk_fsdev_umount_cpl_cb cb_fn,
void * cb_arg )

Unmount the filesystem.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called.

NOTE: on unmount the lookup count for all fobjects implicitly drops to zero.

◆ spdk_fsdev_unlink()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
parent_fobjectParent directory
nameName to remove.
cb_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects -ENOMEM - operation cannot be initiated as there is not enough memory available

◆ spdk_fsdev_write()

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.

Parameters
descFilesystem device descriptor.
chI/O channel.
uniqueUnique I/O id.
fobjectFile object.
fhandleFile handle.
sizeNumber of bytes to write.
offsOffset to write to.
flagsOperation flags.
iovArray of iovec to where the data is stored.
iovcntSize of the iov array.
optsOptional 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_fnCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success. On success, the callback will always be called (even if the request ultimately failed). Return negated errno on failure, in which case the callback will not be called. -ENOBUFS - operation cannot be initiated due to a lack of the internal IO objects