xref: /haiku/src/add-ons/kernel/file_systems/userlandfs/server/beos/fs_cache.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2 	Copyright 1999-2001, Be Incorporated.   All Rights Reserved.
3 	This file may be used under the terms of the Be Sample Code License.
4 */
5 
6 #ifndef USERLAND_FS_BEOS_FS_CACHE_H
7 #define USERLAND_FS_BEOS_FS_CACHE_H
8 
9 #include <BeBuild.h>
10 
11 #ifndef _IMPEXP_KERNEL
12 #define _IMPEXP_KERNEL
13 #endif
14 
15 #ifdef __cplusplus
16 	extern "C" {
17 #endif
18 
19 extern _IMPEXP_KERNEL int   beos_init_block_cache(int max_blocks, int flags);
20 extern _IMPEXP_KERNEL void  beos_shutdown_block_cache(void);
21 
22 extern _IMPEXP_KERNEL void  beos_force_cache_flush(int dev,
23 								int prefer_log_blocks);
24 extern _IMPEXP_KERNEL int   beos_flush_blocks(int dev, off_t bnum, int nblocks);
25 extern _IMPEXP_KERNEL int   beos_flush_device(int dev, int warn_locked);
26 
27 extern _IMPEXP_KERNEL int   beos_init_cache_for_device(int fd,
28 								off_t max_blocks);
29 extern _IMPEXP_KERNEL int   beos_remove_cached_device_blocks(int dev,
30 								int allow_write);
31 
32 extern _IMPEXP_KERNEL void *beos_get_block(int dev, off_t bnum, int bsize);
33 extern _IMPEXP_KERNEL void *beos_get_empty_block(int dev, off_t bnum,
34 								int bsize);
35 extern _IMPEXP_KERNEL int   beos_release_block(int dev, off_t bnum);
36 extern _IMPEXP_KERNEL int   beos_mark_blocks_dirty(int dev, off_t bnum,
37 								int nblocks);
38 
39 
40 extern _IMPEXP_KERNEL int  beos_cached_read(int dev, off_t bnum, void *data,
41 								off_t num_blocks, int bsize);
42 extern _IMPEXP_KERNEL int  beos_cached_write(int dev, off_t bnum,
43 								const void *data, off_t num_blocks, int bsize);
44 extern _IMPEXP_KERNEL int  beos_cached_write_locked(int dev, off_t bnum,
45 								const void *data, off_t num_blocks, int bsize);
46 extern _IMPEXP_KERNEL int  beos_set_blocks_info(int dev, off_t *blocks,
47 								int nblocks, void (*func)(off_t bnum,
48 									size_t nblocks, void *arg), void *arg);
49 
50 
51 extern _IMPEXP_KERNEL size_t beos_read_phys_blocks (int fd, off_t bnum,
52 								void *data, uint num_blocks, int bsize);
53 extern _IMPEXP_KERNEL size_t beos_write_phys_blocks(int fd, off_t bnum,
54 								void *data, uint num_blocks, int bsize);
55 
56 #ifdef __cplusplus
57 	}	// extern "C"
58 #endif
59 
60 #endif /* USERLAND_FS_BEOS_FS_CACHE_H */
61