1,5 → 1,5 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
26,23 → 26,32 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
|
/** @addtogroup libfs |
/** @addtogroup libfs |
* @{ |
*/ |
*/ |
/** |
* @file |
*/ |
|
#ifndef LIBFS_LIBFS_H_ |
#define LIBFS_LIBFS_H_ |
#define LIBFS_LIBFS_H_ |
|
#include "../../srv/vfs/vfs.h" |
#include <ipc/vfs.h> |
#include <stdint.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <devmap.h> |
|
typedef struct { |
void *data; /**< Data of the file system implementation. */ |
bool mp_active; |
int phone; |
fs_handle_t fs_handle; |
dev_handle_t dev_handle; |
} mp_data_t; |
|
typedef struct { |
mp_data_t mp_data; /**< Mount point info. */ |
void *data; /**< Data of the file system implementation. */ |
} fs_node_t; |
|
typedef struct { |
58,23 → 67,28 |
unsigned (* lnkcnt_get)(fs_node_t *); |
bool (* has_children)(fs_node_t *); |
fs_node_t *(* root_get)(dev_handle_t); |
char (* plb_get_char)(unsigned pos); |
char (* plb_get_char)(unsigned pos); |
bool (* is_directory)(fs_node_t *); |
bool (* is_file)(fs_node_t *); |
} libfs_ops_t; |
|
typedef struct { |
int fs_handle; /**< File system handle. */ |
ipcarg_t vfs_phonehash; /**< Initial VFS phonehash. */ |
uint8_t *plb_ro; /**< Read-only PLB view. */ |
int fs_handle; /**< File system handle. */ |
ipcarg_t vfs_phonehash; /**< Initial VFS phonehash. */ |
uint8_t *plb_ro; /**< Read-only PLB view. */ |
} fs_reg_t; |
|
extern int fs_register(int, fs_reg_t *, vfs_info_t *, async_client_conn_t); |
|
extern void fs_node_initialize(fs_node_t *); |
|
extern void libfs_mount(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_stat(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_open_node(libfs_ops_t *, fs_handle_t, ipc_callid_t, |
ipc_call_t *); |
|
#endif |
|
/** @} |
*/ |
|