12#include <mos/proto/fs_server.h>
20MOS_RPC_USERFS_MANAGER_SERVER(userfs_manager)
30 size_t userfs_fsnamelen =
strlen(
"userfs.") +
strlen(req->fs.name) + 1;
31 userfs->
fs.
name = kmalloc(userfs_fsnamelen);
38 snprintf((
char *) userfs->
fs.
name, userfs_fsnamelen,
"userfs.%s", req->fs.name);
41 resp->result.success =
true;
54 pr_emerg(
"fs_rpc_execute_server exited");
MOSAPI char * strdup(const char *src)
MOSAPI void linked_list_init(list_node_t *head_node)
Initialise a circular double linked list.
#define list_node(element)
Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above.
void vfs_register_filesystem(filesystem_t *fs)
thread_t * kthread_create(thread_entry_t entry, void *arg, const char *name)
Create a kernel-mode thread.
#define MOS_ARRAY_SIZE(x)
int snprintf(char *__restrict str, size_t size, const char *__restrict format,...)
static size_t strlen(const char *s)
#define pr_emerg(fmt,...)
@ RPC_RESULT_SERVER_INTERNAL_ERROR
MOSAPI rpc_server_t * rpc_server_create(const char *server_name, void *data)
Create a new RPC server.
MOSAPI bool rpc_server_register_functions(rpc_server_t *server, const rpc_function_info_t *functions, size_t count)
Register multiple functions with the server.
MOSAPI void rpc_server_exec(rpc_server_t *server)
Run the server, this function will not return until the server is destroyed.
#define MOS_INIT(_comp, _fn)
#define SLAB_AUTOINIT(name, var, type)
dentry_t *(* mount)(filesystem_t *fs, const char *dev_name, const char *mount_options)
const char * rpc_server_name
The name of the RPC server.
filesystem_t fs
The filesystem, "userfs.<name>".
dentry_t * userfs_fsop_mount(filesystem_t *fs, const char *device, const char *options)
static void userfs_manager_rpc_init()
static slab_t * userfs_slab
static rpc_result_code_t userfs_manager_register_filesystem(rpc_context_t *, mosrpc_userfs_register_request *req, mosrpc_userfs_register_response *resp)
static void userfs_manager_server_exec(void *arg)