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

Operations on a FUSE fsdev dispatcher. More...

Typedefs

typedef void(* spdk_fuse_dispatcher_create_cpl_cb) (void *cb_arg, struct spdk_fuse_dispatcher *disp)
 FUSE fsdev dispatcher create completion callback.
 
typedef void(* spdk_fuse_dispatcher_submit_cpl_cb) (void *cb_arg, int error)
 FUSE fsdev dispatcher submit completion callback.
 
typedef void(* spdk_fuse_dispatcher_delete_cpl_cb) (void *cb_arg, int error)
 FUSE fsdev dispatcher delete completion callback.
 
typedef void(* spdk_fuse_dispatcher_event_cb) (enum spdk_fuse_dispatcher_event_type type, struct spdk_fuse_dispatcher *disp, void *event_ctx)
 FUSE fsdev dispatcher event callback.
 

Enumerations

enum  spdk_fuse_arch {
  SPDK_FUSE_ARCH_NATIVE , SPDK_FUSE_ARCH_X86 , SPDK_FUSE_ARCH_X86_64 , SPDK_FUSE_ARCH_ARM ,
  SPDK_FUSE_ARCH_ARM64 , _SPDK_FUSE_ARCH_LAST
}
 
enum  spdk_fuse_dispatcher_event_type { SPDK_FUSE_DISP_EVENT_FSDEV_REMOVE }
 Asynchronous event type.
 

Functions

int spdk_fuse_dispatcher_create (const char *fsdev_name, spdk_fuse_dispatcher_event_cb event_cb, void *event_ctx, spdk_fuse_dispatcher_create_cpl_cb cb, void *cb_arg)
 Create a FUSE fsdev dispatcher.
 
int spdk_fuse_dispatcher_set_arch (struct spdk_fuse_dispatcher *disp, enum spdk_fuse_arch fuse_arch)
 Set a FUSE request source's HW architecture.
 
const char * spdk_fuse_dispatcher_get_fsdev_name (struct spdk_fuse_dispatcher *disp)
 Get underlying fsdev name.
 
struct spdk_io_channel * spdk_fuse_dispatcher_get_io_channel (struct spdk_fuse_dispatcher *disp)
 Obtain an I/O channel for the FUSE fsdev dispatcher object.
 
int spdk_fuse_dispatcher_submit_request (struct spdk_fuse_dispatcher *disp, struct spdk_io_channel *ch, struct iovec *in_iov, int in_iovcnt, struct iovec *out_iov, int out_iovcnt, spdk_fuse_dispatcher_submit_cpl_cb cb, void *cb_arg)
 Submit FUSE request.
 
int spdk_fuse_dispatcher_delete (struct spdk_fuse_dispatcher *disp, spdk_fuse_dispatcher_delete_cpl_cb cb, void *cb_arg)
 Delete a FUSE fsdev dispatcher.
 

Detailed Description

Operations on a FUSE fsdev dispatcher.

Typedef Documentation

◆ spdk_fuse_dispatcher_create_cpl_cb

typedef void(* spdk_fuse_dispatcher_create_cpl_cb) (void *cb_arg, struct spdk_fuse_dispatcher *disp)

FUSE fsdev dispatcher create completion callback.

Parameters
cb_argCallback argument specified upon create operation.
dispFUSE fsdev dispatcher object. NULL if creation failed.

◆ spdk_fuse_dispatcher_delete_cpl_cb

typedef void(* spdk_fuse_dispatcher_delete_cpl_cb) (void *cb_arg, int error)

FUSE fsdev dispatcher delete completion callback.

Parameters
cb_argCallback argument specified upon delete operation.
error0 if the operation succeeded, a negative error code otherwise.

◆ spdk_fuse_dispatcher_event_cb

typedef void(* spdk_fuse_dispatcher_event_cb) (enum spdk_fuse_dispatcher_event_type type, struct spdk_fuse_dispatcher *disp, void *event_ctx)

FUSE fsdev dispatcher event callback.

Parameters
typeEvent type.
dispFUSE fsdev dispatcher object.
event_ctxContext for the filesystem device event.

◆ spdk_fuse_dispatcher_submit_cpl_cb

typedef void(* spdk_fuse_dispatcher_submit_cpl_cb) (void *cb_arg, int error)

FUSE fsdev dispatcher submit completion callback.

Parameters
cb_argCallback argument specified upon submit operation.
error0 if the operation succeeded, a negative error code otherwise.

Function Documentation

◆ spdk_fuse_dispatcher_create()

int spdk_fuse_dispatcher_create ( const char * fsdev_name,
spdk_fuse_dispatcher_event_cb event_cb,
void * event_ctx,
spdk_fuse_dispatcher_create_cpl_cb cb,
void * cb_arg )

Create a FUSE fsdev dispatcher.

Parameters
fsdev_nameName of the fsdev to work with.
event_cbDispatcher event callback.
event_ctxDispatcher event callback's context.
cbCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success, a negative error code otherwise. On success, the callback will always be called (even if the request ultimately failed).

◆ spdk_fuse_dispatcher_delete()

int spdk_fuse_dispatcher_delete ( struct spdk_fuse_dispatcher * disp,
spdk_fuse_dispatcher_delete_cpl_cb cb,
void * cb_arg )

Delete a FUSE fsdev dispatcher.

Parameters
dispFUSE fsdev dispatcher object.
cbCompletion callback.
cb_argContext to be passed to the completion callback.
Returns
0 on success, a negative error code otherwise. On success, the callback will always be called (even if the request ultimately failed).

◆ spdk_fuse_dispatcher_get_fsdev_name()

const char * spdk_fuse_dispatcher_get_fsdev_name ( struct spdk_fuse_dispatcher * disp)

Get underlying fsdev name.

Parameters
dispFUSE fsdev dispatcher object.
Returns
fsdev name

◆ spdk_fuse_dispatcher_get_io_channel()

struct spdk_io_channel * spdk_fuse_dispatcher_get_io_channel ( struct spdk_fuse_dispatcher * disp)

Obtain an I/O channel for the FUSE fsdev dispatcher object.

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
dispFUSE fsdev dispatcher object.
Returns
A handle to the I/O channel or NULL on failure.

◆ spdk_fuse_dispatcher_set_arch()

int spdk_fuse_dispatcher_set_arch ( struct spdk_fuse_dispatcher * disp,
enum spdk_fuse_arch fuse_arch )

Set a FUSE request source's HW architecture.

Unless this function is called explicitly, the arch set to SPDK_FUSE_ARCH_NATIVE.

Parameters
dispFUSE fsdev dispatcher object.
fuse_archFUSE request source's HW architecture
Returns
0 on success or -EINVAL if the architecture is not supported

◆ spdk_fuse_dispatcher_submit_request()

int spdk_fuse_dispatcher_submit_request ( struct spdk_fuse_dispatcher * disp,
struct spdk_io_channel * ch,
struct iovec * in_iov,
int in_iovcnt,
struct iovec * out_iov,
int out_iovcnt,
spdk_fuse_dispatcher_submit_cpl_cb cb,
void * cb_arg )

Submit FUSE request.

Parameters
dispFUSE fsdev dispatcher object.
chI/O channel obtained from the spdk_fuse_dispatcher_get_io_channel.
in_iovInput IO vectors array.
in_iovcntSize of the input IO vectors array.
out_iovOutput IO vectors array.
out_iovcntSize of the output IO vectors array.
cbCompletion 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 - the request cannot be submitted due to a lack of the internal IO objects -EINVAL - the request cannot be submitted as some FUSE request data is incorrect