Changed the VM hooks a bit to better match the corresponding driver hooks.

Added file cache hook function that gets the extents of a file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8842 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-09-04 17:13:45 +00:00
parent 9edfb372ab
commit 7af4ca8acf
+14 -5
View File
@@ -1,15 +1,16 @@
/* File System Interface Layer Definition /* File System Interface Layer Definition
** **
** Distributed under the terms of the OpenBeOS License. ** Distributed under the terms of the Haiku License.
*/ */
#ifndef _FS_INTERFACE_H #ifndef _FS_INTERFACE_H
#define _FS_INTERFACE_H #define _FS_INTERFACE_H
#include <OS.h> #include <OS.h>
#include <module.h> #include <module.h>
#include <vfs_types.h> #include <vfs_types.h>
struct dirent; struct dirent;
struct stat; struct stat;
struct fs_info; struct fs_info;
@@ -36,6 +37,11 @@ enum write_stat_mask {
/* passed to write_fs_info() */ /* passed to write_fs_info() */
#define FS_WRITE_FSINFO_NAME 0x0001 #define FS_WRITE_FSINFO_NAME 0x0001
struct file_io_vec {
off_t offset;
off_t length;
};
#define B_CURRENT_FS_API_VERSION "/v1" #define B_CURRENT_FS_API_VERSION "/v1"
#ifdef __cplusplus #ifdef __cplusplus
@@ -62,9 +68,12 @@ typedef struct file_system_info {
status_t (*remove_vnode)(fs_volume fs, fs_vnode vnode, bool reenter); status_t (*remove_vnode)(fs_volume fs, fs_vnode vnode, bool reenter);
/* VM file access */ /* VM file access */
status_t (*can_page)(fs_volume fs, fs_vnode v); bool (*can_page)(fs_volume fs, fs_vnode vnode);
ssize_t (*read_pages)(fs_volume fs, fs_vnode v, iovecs *vecs, off_t pos); status_t (*read_pages)(fs_volume fs, fs_vnode vnode, off_t pos, const iovec *vecs, size_t count, size_t *_numBytes);
ssize_t (*write_pages)(fs_volume fs, fs_vnode v, iovecs *vecs, off_t pos); status_t (*write_pages)(fs_volume fs, fs_vnode vnode, off_t pos, const iovec *vecs, size_t count, size_t *_numBytes);
/* cache file access */
status_t (*get_file_map)(fs_volume fs, fs_vnode vnode, struct file_io_vec *vecs, size_t *_count);
/* common operations */ /* common operations */
status_t (*ioctl)(fs_volume fs, fs_vnode v, fs_cookie cookie, ulong op, void *buffer, size_t length); status_t (*ioctl)(fs_volume fs, fs_vnode v, fs_cookie cookie, ulong op, void *buffer, size_t length);