Added fssh_volume_for_vnode() and fssh_do[_iterative]_fd_io() to the
FS shell. The latter two lack an implementation yet, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26670 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7df40c23f6
commit
7e3c202478
@ -871,6 +871,10 @@
|
||||
#define mount_id fssh_mount_id
|
||||
#define vnode_id fssh_vnode_id
|
||||
|
||||
// TODO: These two don't belong here!
|
||||
#define IORequest FSSHIORequest
|
||||
#define io_request fssh_io_request
|
||||
|
||||
/* additional flags passed to write_stat() */
|
||||
#define B_STAT_SIZE_INSECURE FSSH_B_STAT_SIZE_INSECURE
|
||||
|
||||
@ -893,6 +897,9 @@
|
||||
|
||||
|
||||
/* file system add-ons only prototypes */
|
||||
#define iterative_io_get_vecs fssh_iterative_io_get_vecs
|
||||
#define iterative_io_finished fssh_iterative_io_finished
|
||||
|
||||
#define new_vnode fssh_new_vnode
|
||||
#define publish_vnode fssh_publish_vnode
|
||||
#define get_vnode fssh_get_vnode
|
||||
@ -900,10 +907,13 @@
|
||||
#define remove_vnode fssh_remove_vnode
|
||||
#define unremove_vnode fssh_unremove_vnode
|
||||
#define get_vnode_removed fssh_get_vnode_removed
|
||||
#define volume_for_vnode fssh_volume_for_vnode
|
||||
#define read_pages fssh_read_pages
|
||||
#define write_pages fssh_write_pages
|
||||
#define read_file_io_vec_pages fssh_read_file_io_vec_pages
|
||||
#define write_file_io_vec_pages fssh_write_file_io_vec_pages
|
||||
#define do_fd_io fssh_do_fd_io
|
||||
#define do_iterative_fd_io fssh_do_iterative_fd_io
|
||||
|
||||
#define notify_entry_created fssh_notify_entry_created
|
||||
#define notify_entry_removed fssh_notify_entry_removed
|
||||
|
@ -328,6 +328,14 @@ typedef struct fssh_file_system_module_info {
|
||||
|
||||
|
||||
/* file system add-ons only prototypes */
|
||||
|
||||
// callbacks for do_iterative_fd_io()
|
||||
typedef fssh_status_t (*fssh_iterative_io_get_vecs)(void *cookie,
|
||||
fssh_io_request* request, fssh_off_t offset, fssh_size_t size,
|
||||
struct fssh_file_io_vec *vecs, fssh_size_t *_count);
|
||||
typedef fssh_status_t (*fssh_iterative_io_finished)(void* cookie,
|
||||
fssh_io_request* request, fssh_status_t status);
|
||||
|
||||
extern fssh_status_t fssh_new_vnode(fssh_fs_volume *volume,
|
||||
fssh_vnode_id vnodeID, void *privateNode,
|
||||
fssh_fs_vnode_ops *ops);
|
||||
@ -344,6 +352,8 @@ extern fssh_status_t fssh_unremove_vnode(fssh_fs_volume *volume,
|
||||
fssh_vnode_id vnodeID);
|
||||
extern fssh_status_t fssh_get_vnode_removed(fssh_fs_volume *volume,
|
||||
fssh_vnode_id vnodeID, bool* removed);
|
||||
extern fssh_fs_volume* fssh_volume_for_vnode(fssh_fs_vnode *vnode);
|
||||
|
||||
|
||||
extern fssh_status_t fssh_read_pages(int fd, fssh_off_t pos,
|
||||
const struct fssh_iovec *vecs, fssh_size_t count,
|
||||
@ -361,6 +371,10 @@ extern fssh_status_t fssh_write_file_io_vec_pages(int fd,
|
||||
fssh_size_t fileVecCount, const struct fssh_iovec *vecs,
|
||||
fssh_size_t vecCount, uint32_t *_vecIndex,
|
||||
fssh_size_t *_vecOffset, fssh_size_t *_bytes);
|
||||
extern fssh_status_t fssh_do_fd_io(int fd, fssh_io_request *request);
|
||||
extern fssh_status_t fssh_do_iterative_fd_io(int fd, fssh_io_request *request,
|
||||
fssh_iterative_io_get_vecs getVecs,
|
||||
fssh_iterative_io_finished finished, void *cookie);
|
||||
|
||||
extern fssh_status_t fssh_notify_entry_created(fssh_mount_id device,
|
||||
fssh_vnode_id directory, const char *name, fssh_vnode_id node);
|
||||
|
@ -2105,6 +2105,17 @@ fssh_get_vnode_removed(fssh_fs_volume *volume, fssh_vnode_id vnodeID, bool* remo
|
||||
}
|
||||
|
||||
|
||||
extern "C" fssh_fs_volume*
|
||||
fssh_volume_for_vnode(fssh_fs_vnode *_vnode)
|
||||
{
|
||||
if (_vnode == NULL)
|
||||
return NULL;
|
||||
|
||||
struct vnode* vnode = static_cast<struct vnode*>(_vnode);
|
||||
return vnode->mount->volume;
|
||||
}
|
||||
|
||||
|
||||
//! Works directly on the host's file system
|
||||
extern "C" fssh_status_t
|
||||
fssh_read_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
@ -5650,3 +5661,6 @@ _kern_open_query(fssh_dev_t device, const char *query, fssh_size_t queryLength,
|
||||
|
||||
|
||||
} // namespace FSShell
|
||||
|
||||
|
||||
#include "vfs_request_io.cpp"
|
||||
|
29
src/tools/fs_shell/vfs_request_io.cpp
Normal file
29
src/tools/fs_shell/vfs_request_io.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
// included by vfs.cpp
|
||||
|
||||
//#include "io_requests.h"
|
||||
|
||||
|
||||
// #pragma mark - public API
|
||||
|
||||
|
||||
extern "C" fssh_status_t
|
||||
fssh_do_fd_io(int fd, fssh_io_request* request)
|
||||
{
|
||||
fssh_panic("fssh_do_fd_io() not yet implemented");
|
||||
return FSSH_B_BAD_VALUE;
|
||||
}
|
||||
|
||||
|
||||
extern "C" fssh_status_t
|
||||
fssh_do_iterative_fd_io(int fd, fssh_io_request* request,
|
||||
fssh_iterative_io_get_vecs getVecs,
|
||||
fssh_iterative_io_finished finished, void* cookie)
|
||||
{
|
||||
fssh_panic("fssh_do_iterative_fd_io() not yet implemented");
|
||||
return FSSH_B_BAD_VALUE;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user