* Reorganized the FS interface a little:

- Moved most file_system_module_info hooks into separate structures.
    Those that operate on mounted volumes to fs_volume_ops, those
    operating on a vnode to fs_vnode_ops.
  - Got rid of the fs_volume, fs_cookie, fs_vnode typedefs. We use void*
    again.
  - Instead of a void* volume and node cookie hooks are passed a
    fs_volume and fs_vnode structure pointer, which contain the cookie
    and an ops pointer (fs_volume a few more things).
  - The VFS {new,publish,get,...}_vnode() functions take a fs_volume*
    instead of the volume ID. So does vfs_get_fs_node_from_path().
  - Added type and flags arguments to publish_vnode() and the
    get_vnode() hook and removed the type argument from lookup() hook.
    Added vnode::type using formerly unused bits to store the node type.
    Simplified a few things in the VFS due to the now always available
    node type.
  - Added fs_volume_ops::{create,delete}_sub_vnode() and
    fs_vnode_ops::get_super_vnode() hooks. They are used to support file
    system layers, e.g. allowing to extend an FS not supporting BeOS
    attribute with attribute support. Needs some more work in the VFS.
  - Added fs_vnode_ops::create_special_node() hook for creating special
    nodes (e.g. FIFOs).
* Adjusted the built-in file systems and BFS according to the interface
  changes. Removed all other FSs from the image for the time being.
  We'll see whether further API changes are necessary before porting
  them.
* Adjusted the bfs_shell accordingly.
* Implemented create_special_node() in rootfs to support special nodes.
* Added support for FIFOs:
  - Added syscall _kern_create_fifo() (used by mkfifo()), which creates
    a special node (type S_IFIFO) in the respective file system.
  - When a special node is published the VFS creates a respective sub
    node. Currently only FIFOs are supported.
  - Added a little support for FIFO subnodes by using functionality from
    the pipefs.
  - Added mkfifo to the image. It can create FIFOs in the rootfs, but
    the FIFOs aren't really usable ATM, since they still work like
    pipes, i.e. readers and writers need to have them open at the same
    time.
* Some smaller changes in the VFS:
  - Made the *_CALL macros nicer to use (vargs).
  - Refactored FS entry lookup into new function lookup_dir_entry().
  - create_vnode() no longer just calls the FS create() hook. First it
    looks up the entry and uses open_vnode(), if it already exists. This
    is necessary for two reasons: 1) The FS might not support create()
    while still allowing to open() entries. 2) When the FS has other
    layers on to of it (or the respective node) it might not be
    responsible for opening the node.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24816 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-04-05 23:05:16 +00:00
parent 5d7ee5e84a
commit 7ffafac8d7
21 changed files with 2410 additions and 1586 deletions
+237 -183
View File
@@ -24,9 +24,7 @@ typedef fssh_dev_t fssh_mount_id;
typedef fssh_ino_t fssh_vnode_id;
/* the file system's private data structures */
typedef void *fssh_fs_volume;
typedef void *fssh_fs_cookie;
typedef void *fssh_fs_vnode;
/* additional flags passed to write_stat() */
#define FSSH_B_STAT_SIZE_INSECURE 0x2000
@@ -41,10 +39,232 @@ struct fssh_file_io_vec {
#define FSSH_B_CURRENT_FS_API_VERSION "/v1"
// flags for publish_vnode() and fs_volume_ops::get_vnode()
#define FSSH_B_VNODE_PUBLISH_REMOVED 0x01
#define FSSH_B_VNODE_DONT_CREATE_SPECIAL_SUB_NODE 0x02
#ifdef __cplusplus
extern "C" {
#endif
typedef struct fssh_fs_volume fssh_fs_volume;
typedef struct fssh_fs_volume_ops fssh_fs_volume_ops;
typedef struct fssh_fs_vnode fssh_fs_vnode;
typedef struct fssh_fs_vnode_ops fssh_fs_vnode_ops;
struct fssh_fs_volume {
fssh_dev_t id;
int32_t layer;
void* private_volume;
fssh_fs_volume_ops* ops;
fssh_fs_volume* sub_volume;
fssh_fs_volume* super_volume;
};
struct fssh_fs_vnode {
void* private_node;
fssh_fs_vnode_ops* ops;
};
struct fssh_fs_volume_ops {
fssh_status_t (*unmount)(fssh_fs_volume *volume);
fssh_status_t (*read_fs_info)(fssh_fs_volume *volume,
struct fssh_fs_info *info);
fssh_status_t (*write_fs_info)(fssh_fs_volume *volume,
const struct fssh_fs_info *info, uint32_t mask);
fssh_status_t (*sync)(fssh_fs_volume *volume);
fssh_status_t (*get_vnode)(fssh_fs_volume *volume, fssh_vnode_id id,
fssh_fs_vnode *_vnode, int *_type, uint32_t *_flags,
bool reenter);
/* index directory & index operations */
fssh_status_t (*open_index_dir)(fssh_fs_volume *volume,
fssh_fs_cookie *cookie);
fssh_status_t (*close_index_dir)(fssh_fs_volume *volume,
fssh_fs_cookie cookie);
fssh_status_t (*free_index_dir_cookie)(fssh_fs_volume *volume,
fssh_fs_cookie cookie);
fssh_status_t (*read_index_dir)(fssh_fs_volume *volume,
fssh_fs_cookie cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_num);
fssh_status_t (*rewind_index_dir)(fssh_fs_volume *volume,
fssh_fs_cookie cookie);
fssh_status_t (*create_index)(fssh_fs_volume *volume, const char *name,
uint32_t type, uint32_t flags);
fssh_status_t (*remove_index)(fssh_fs_volume *volume, const char *name);
fssh_status_t (*read_index_stat)(fssh_fs_volume *volume, const char *name,
struct fssh_stat *stat);
/* query operations */
fssh_status_t (*open_query)(fssh_fs_volume *volume, const char *query,
uint32_t flags, fssh_port_id port, uint32_t token,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_query)(fssh_fs_volume *volume, fssh_fs_cookie cookie);
fssh_status_t (*free_query_cookie)(fssh_fs_volume *volume,
fssh_fs_cookie cookie);
fssh_status_t (*read_query)(fssh_fs_volume *volume, fssh_fs_cookie cookie,
struct fssh_dirent *buffer, fssh_size_t bufferSize,
uint32_t *_num);
fssh_status_t (*rewind_query)(fssh_fs_volume *volume,
fssh_fs_cookie cookie);
/* support for FS layers */
fssh_status_t (*create_sub_vnode)(fssh_fs_volume *volume, fssh_ino_t id,
fssh_fs_vnode *vnode);
fssh_status_t (*delete_sub_vnode)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode);
};
struct fssh_fs_vnode_ops {
/* vnode operations */
fssh_status_t (*lookup)(fssh_fs_volume *volume, fssh_fs_vnode *dir,
const char *name, fssh_vnode_id *_id);
fssh_status_t (*get_vnode_name)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, char *buffer, fssh_size_t bufferSize);
fssh_status_t (*put_vnode)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
bool reenter);
fssh_status_t (*remove_vnode)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
bool reenter);
/* VM file access */
bool (*can_page)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read_pages)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
fssh_status_t (*write_pages)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
/* cache file access */
fssh_status_t (*get_file_map)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_off_t offset, fssh_size_t size,
struct fssh_file_io_vec *vecs, fssh_size_t *_count);
/* common operations */
fssh_status_t (*ioctl)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_ulong op, void *buffer,
fssh_size_t length);
fssh_status_t (*set_flags)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, int flags);
fssh_status_t (*select)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, uint8_t event, uint32_t ref,
fssh_selectsync *sync);
fssh_status_t (*deselect)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, uint8_t event, fssh_selectsync *sync);
fssh_status_t (*fsync)(fssh_fs_volume *volume, fssh_fs_vnode *vnode);
fssh_status_t (*read_symlink)(fssh_fs_volume *volume, fssh_fs_vnode *link,
char *buffer, fssh_size_t *_bufferSize);
fssh_status_t (*create_symlink)(fssh_fs_volume *volume, fssh_fs_vnode *dir,
const char *name, const char *path, int mode);
fssh_status_t (*link)(fssh_fs_volume *volume, fssh_fs_vnode *dir,
const char *name, fssh_fs_vnode *vnode);
fssh_status_t (*unlink)(fssh_fs_volume *volume, fssh_fs_vnode *dir,
const char *name);
fssh_status_t (*rename)(fssh_fs_volume *volume, fssh_fs_vnode *fromDir,
const char *fromName, fssh_fs_vnode *toDir, const char *toName);
fssh_status_t (*access)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
int mode);
fssh_status_t (*read_stat)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
struct fssh_stat *stat);
fssh_status_t (*write_stat)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
const struct fssh_stat *stat, uint32_t statMask);
/* file operations */
fssh_status_t (*create)(fssh_fs_volume *volume, fssh_fs_vnode *dir,
const char *name, int openMode, int perms,
fssh_fs_cookie *_cookie, fssh_vnode_id *_newVnodeID);
fssh_status_t (*open)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
int openMode, fssh_fs_cookie *_cookie);
fssh_status_t (*close)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_cookie)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_size_t *length);
fssh_status_t (*write)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
fssh_size_t *length);
/* directory operations */
fssh_status_t (*create_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
const char *name, int perms, fssh_vnode_id *_newVnodeID);
fssh_status_t (*remove_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
const char *name);
fssh_status_t (*open_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_dir_cookie)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie);
fssh_status_t (*read_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_num);
fssh_status_t (*rewind_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
/* attribute directory operations */
fssh_status_t (*open_attr_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_attr_dir)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie);
fssh_status_t (*free_attr_dir_cookie)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie);
fssh_status_t (*read_attr_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_num);
fssh_status_t (*rewind_attr_dir)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie);
/* attribute operations */
fssh_status_t (*create_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
const char *name, uint32_t type, int openMode,
fssh_fs_cookie *_cookie);
fssh_status_t (*open_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
const char *name, int openMode, fssh_fs_cookie *_cookie);
fssh_status_t (*close_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_attr_cookie)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie);
fssh_status_t (*read_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_size_t *length);
fssh_status_t (*write_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
fssh_size_t *length);
fssh_status_t (*read_attr_stat)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie,
struct fssh_stat *stat);
fssh_status_t (*write_attr_stat)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_cookie cookie,
const struct fssh_stat *stat, int statMask);
fssh_status_t (*rename_attr)(fssh_fs_volume *volume,
fssh_fs_vnode *fromVnode, const char *fromName,
fssh_fs_vnode *toVnode, const char *toName);
fssh_status_t (*remove_attr)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
const char *name);
/* support for vnode and FS layers */
fssh_status_t (*create_special_node)(fssh_fs_volume *volume,
fssh_fs_vnode *dir, const char *name, fssh_fs_vnode *subVnode,
fssh_mode_t mode, uint32_t flags, fssh_fs_vnode *_superVnode,
fssh_ino_t *_nodeID);
fssh_status_t (*get_super_vnode)(fssh_fs_volume *volume,
fssh_fs_vnode *vnode, fssh_fs_volume *superVolume,
fssh_fs_vnode *superVnode);
};
typedef struct fssh_file_system_module_info {
struct fssh_module_info info;
const char* pretty_name;
@@ -60,177 +280,8 @@ typedef struct fssh_file_system_module_info {
void (*free_partition_content_cookie)(fssh_partition_data *partition);
/* general operations */
fssh_status_t (*mount)(fssh_mount_id id, const char *device, uint32_t flags,
const char *args, fssh_fs_volume *_fs,
fssh_vnode_id *_rootVnodeID);
fssh_status_t (*unmount)(fssh_fs_volume fs);
fssh_status_t (*read_fs_info)(fssh_fs_volume fs, struct fssh_fs_info *info);
fssh_status_t (*write_fs_info)(fssh_fs_volume fs,
const struct fssh_fs_info *info, uint32_t mask);
fssh_status_t (*sync)(fssh_fs_volume fs);
/* vnode operations */
fssh_status_t (*lookup)(fssh_fs_volume fs, fssh_fs_vnode dir,
const char *name, fssh_vnode_id *_id, int *_type);
fssh_status_t (*get_vnode_name)(fssh_fs_volume fs, fssh_fs_vnode vnode,
char *buffer, fssh_size_t bufferSize);
fssh_status_t (*get_vnode)(fssh_fs_volume fs, fssh_vnode_id id,
fssh_fs_vnode *_vnode, bool reenter);
fssh_status_t (*put_vnode)(fssh_fs_volume fs, fssh_fs_vnode vnode,
bool reenter);
fssh_status_t (*remove_vnode)(fssh_fs_volume fs, fssh_fs_vnode vnode,
bool reenter);
/* VM file access */
bool (*can_page)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read_pages)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
fssh_status_t (*write_pages)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
/* cache file access */
fssh_status_t (*get_file_map)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_off_t offset, fssh_size_t size,
struct fssh_file_io_vec *vecs, fssh_size_t *_count);
/* common operations */
fssh_status_t (*ioctl)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_ulong op, void *buffer,
fssh_size_t length);
fssh_status_t (*set_flags)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, int flags);
fssh_status_t (*select)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, uint8_t event, uint32_t ref,
fssh_selectsync *sync);
fssh_status_t (*deselect)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, uint8_t event, fssh_selectsync *sync);
fssh_status_t (*fsync)(fssh_fs_volume fs, fssh_fs_vnode vnode);
fssh_status_t (*read_symlink)(fssh_fs_volume fs, fssh_fs_vnode link,
char *buffer, fssh_size_t *_bufferSize);
fssh_status_t (*create_symlink)(fssh_fs_volume fs, fssh_fs_vnode dir,
const char *name, const char *path, int mode);
fssh_status_t (*link)(fssh_fs_volume fs, fssh_fs_vnode dir,
const char *name, fssh_fs_vnode vnode);
fssh_status_t (*unlink)(fssh_fs_volume fs, fssh_fs_vnode dir,
const char *name);
fssh_status_t (*rename)(fssh_fs_volume fs, fssh_fs_vnode fromDir,
const char *fromName, fssh_fs_vnode toDir, const char *toName);
fssh_status_t (*access)(fssh_fs_volume fs, fssh_fs_vnode vnode, int mode);
fssh_status_t (*read_stat)(fssh_fs_volume fs, fssh_fs_vnode vnode,
struct fssh_stat *stat);
fssh_status_t (*write_stat)(fssh_fs_volume fs, fssh_fs_vnode vnode,
const struct fssh_stat *stat, uint32_t statMask);
/* file operations */
fssh_status_t (*create)(fssh_fs_volume fs, fssh_fs_vnode dir,
const char *name, int openMode, int perms,
fssh_fs_cookie *_cookie, fssh_vnode_id *_newVnodeID);
fssh_status_t (*open)(fssh_fs_volume fs, fssh_fs_vnode vnode, int openMode,
fssh_fs_cookie *_cookie);
fssh_status_t (*close)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_cookie)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_size_t *length);
fssh_status_t (*write)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
fssh_size_t *length);
/* directory operations */
fssh_status_t (*create_dir)(fssh_fs_volume fs, fssh_fs_vnode parent,
const char *name, int perms, fssh_vnode_id *_newVnodeID);
fssh_status_t (*remove_dir)(fssh_fs_volume fs, fssh_fs_vnode parent,
const char *name);
fssh_status_t (*open_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_dir_cookie)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_num);
fssh_status_t (*rewind_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
/* attribute directory operations */
fssh_status_t (*open_attr_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_attr_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_attr_dir_cookie)(fssh_fs_volume fs,
fssh_fs_vnode vnode, fssh_fs_cookie cookie);
fssh_status_t (*read_attr_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_num);
fssh_status_t (*rewind_attr_dir)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
/* attribute operations */
fssh_status_t (*create_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
const char *name, uint32_t type, int openMode,
fssh_fs_cookie *_cookie);
fssh_status_t (*open_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
const char *name, int openMode, fssh_fs_cookie *_cookie);
fssh_status_t (*close_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*free_attr_cookie)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie);
fssh_status_t (*read_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_size_t *length);
fssh_status_t (*write_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
fssh_size_t *length);
fssh_status_t (*read_attr_stat)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, struct fssh_stat *stat);
fssh_status_t (*write_attr_stat)(fssh_fs_volume fs, fssh_fs_vnode vnode,
fssh_fs_cookie cookie, const struct fssh_stat *stat,
int statMask);
fssh_status_t (*rename_attr)(fssh_fs_volume fs, fssh_fs_vnode fromVnode,
const char *fromName, fssh_fs_vnode toVnode,
const char *toName);
fssh_status_t (*remove_attr)(fssh_fs_volume fs, fssh_fs_vnode vnode,
const char *name);
/* index directory & index operations */
fssh_status_t (*open_index_dir)(fssh_fs_volume fs, fssh_fs_cookie *cookie);
fssh_status_t (*close_index_dir)(fssh_fs_volume fs, fssh_fs_cookie cookie);
fssh_status_t (*free_index_dir_cookie)(fssh_fs_volume fs,
fssh_fs_cookie cookie);
fssh_status_t (*read_index_dir)(fssh_fs_volume fs, fssh_fs_cookie cookie,
struct fssh_dirent *buffer, fssh_size_t bufferSize,
uint32_t *_num);
fssh_status_t (*rewind_index_dir)(fssh_fs_volume fs, fssh_fs_cookie cookie);
fssh_status_t (*create_index)(fssh_fs_volume fs, const char *name,
uint32_t type, uint32_t flags);
fssh_status_t (*remove_index)(fssh_fs_volume fs, const char *name);
fssh_status_t (*read_index_stat)(fssh_fs_volume fs, const char *name,
struct fssh_stat *stat);
/* query operations */
fssh_status_t (*open_query)(fssh_fs_volume fs, const char *query,
uint32_t flags, fssh_port_id port, uint32_t token,
fssh_fs_cookie *_cookie);
fssh_status_t (*close_query)(fssh_fs_volume fs, fssh_fs_cookie cookie);
fssh_status_t (*free_query_cookie)(fssh_fs_volume fs,
fssh_fs_cookie cookie);
fssh_status_t (*read_query)(fssh_fs_volume fs, fssh_fs_cookie cookie,
struct fssh_dirent *buffer, fssh_size_t bufferSize,
uint32_t *_num);
fssh_status_t (*rewind_query)(fssh_fs_volume fs, fssh_fs_cookie cookie);
fssh_status_t (*mount)(fssh_fs_volume *volume, const char *device,
uint32_t flags, const char *args, fssh_vnode_id *_rootVnodeID);
/* capability querying (the device is read locked) */
uint32_t (*get_supported_operations)(fssh_partition_data* partition,
@@ -269,20 +320,23 @@ typedef struct fssh_file_system_module_info {
/* file system add-ons only prototypes */
extern fssh_status_t fssh_new_vnode(fssh_mount_id mountID,
fssh_vnode_id vnodeID, fssh_fs_vnode privateNode);
extern fssh_status_t fssh_publish_vnode(fssh_mount_id mountID,
fssh_vnode_id vnodeID, fssh_fs_vnode privateNode);
extern fssh_status_t fssh_get_vnode(fssh_mount_id mountID,
fssh_vnode_id vnodeID, fssh_fs_vnode *_privateNode);
extern fssh_status_t fssh_put_vnode(fssh_mount_id mountID,
extern fssh_status_t fssh_new_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID, void *privateNode,
fssh_fs_vnode_ops *ops);
extern fssh_status_t fssh_publish_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID, void *privateNode,
fssh_fs_vnode_ops *ops, int type, uint32_t flags);
extern fssh_status_t fssh_get_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID, void **_privateNode);
extern fssh_status_t fssh_put_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_remove_vnode(fssh_mount_id mountID,
extern fssh_status_t fssh_remove_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_unremove_vnode(fssh_mount_id mountID,
extern fssh_status_t fssh_unremove_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_get_vnode_removed(fssh_mount_id mountID,
extern fssh_status_t fssh_get_vnode_removed(fssh_fs_volume *volume,
fssh_vnode_id vnodeID, bool* removed);
extern fssh_status_t fssh_read_pages(int fd, fssh_off_t pos,
const struct fssh_iovec *vecs, fssh_size_t count,
fssh_size_t *_numBytes, bool fsReenter);