2 * Copyright (c) 2008 The LOST Project. All rights reserved.
4 * This code is derived from software contributed to the LOST Project
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the LOST Project
18 * and its contributors.
19 * 4. Neither the name of the LOST Project nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
30 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 * Dateisystemressource fuer ext2
49 struct cdi_fs_res res
;
60 int ext2_fs_init(struct cdi_fs_filesystem
* fs
);
61 int ext2_fs_destroy(struct cdi_fs_filesystem
* fs
);
64 int ext2_fs_res_load(struct cdi_fs_stream
* stream
);
65 int ext2_fs_res_unload(struct cdi_fs_stream
* stream
);
66 int ext2_fs_res_remove(struct cdi_fs_stream
* stream
);
67 int ext2_fs_res_rename(struct cdi_fs_stream
* stream
, const char* name
);
68 int ext2_fs_res_move(struct cdi_fs_stream
* stream
, struct cdi_fs_res
* dest
);
69 int ext2_fs_res_assign_class(struct cdi_fs_stream
* stream
,
70 cdi_fs_res_class_t
class);
71 int ext2_fs_res_remove_class(struct cdi_fs_stream
* stream
,
72 cdi_fs_res_class_t
class);
73 int64_t ext2_fs_res_meta_read(struct cdi_fs_stream
* stream
, cdi_fs_meta_t meta
);
74 int ext2_fs_res_meta_write(struct cdi_fs_stream
* stream
, cdi_fs_meta_t meta
,
78 size_t ext2_fs_file_read(struct cdi_fs_stream
* stream
, uint64_t start
,
79 size_t size
, void* data
);
80 size_t ext2_fs_file_write(struct cdi_fs_stream
* stream
, uint64_t start
,
81 size_t size
, const void* data
);
82 int ext2_fs_file_truncate(struct cdi_fs_stream
* stream
, uint64_t size
);
85 cdi_list_t
ext2_fs_dir_list(struct cdi_fs_stream
* stream
);
86 int ext2_fs_dir_create_child(struct cdi_fs_stream
* stream
,
87 const char* name
, struct cdi_fs_res
* parent
);
90 const char* ext2_fs_link_read(struct cdi_fs_stream
* stream
);
91 int ext2_fs_link_write(struct cdi_fs_stream
* stream
, const char* path
);
93 // Cachefunktionen fuer libext2
94 void* cache_create(struct ext2_fs
* fs
, size_t block_size
);
95 void cache_destroy(void* handle
);
96 ext2_cache_block_t
* cache_block(void* handle
, uint64_t block
, int noread
);
97 void cache_block_dirty(ext2_cache_block_t
* b
);
98 void cache_block_free(ext2_cache_block_t
* b
, int dirty
);
101 // Pointer auf die ext2-Ressourcen
102 extern struct cdi_fs_res_res ext2_fs_res
;
103 extern struct cdi_fs_res_file ext2_fs_file
;
104 extern struct cdi_fs_res_dir ext2_fs_dir
;
105 extern struct cdi_fs_res_link ext2_fs_link
;