reiserfslib: add file data and directory iterators
This adds reiserfs_iterate_dir and reiserfs_iterate_file_data to iterate over directories and file block/tail mapping. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
1f65941572
commit
e51777cf55
4 files changed
+207
-9
No files matched your search
+1
-1
@@ -234,7 +234,7 @@ __u16 mask16(int from, int count);
|
||||
__u32 mask32(int from, int count);
|
||||
__u64 mask64(int from, int count);
|
||||
|
||||
int reiserfs_bin_search(void *key, void *base, __u32 num, int width,
|
||||
int reiserfs_bin_search(const void *key, void *base, __u32 num, int width,
|
||||
__u32 * ppos, __compar_fn_t comp_func);
|
||||
|
||||
struct block_handler {
|
||||
|
||||
+27
-3
@@ -122,11 +122,12 @@ int reiserfs_add_entry(reiserfs_filsys_t , struct reiserfs_key *dir,
|
||||
|
||||
struct reiserfs_key *uget_lkey(struct reiserfs_path *path);
|
||||
struct reiserfs_key *uget_rkey(struct reiserfs_path *path);
|
||||
int reiserfs_search_by_key_3(reiserfs_filsys_t , struct reiserfs_key *key,
|
||||
int reiserfs_search_by_key_3(reiserfs_filsys_t , const struct reiserfs_key *key,
|
||||
struct reiserfs_path *path);
|
||||
int reiserfs_search_by_key_4(reiserfs_filsys_t , struct reiserfs_key *key,
|
||||
int reiserfs_search_by_key_4(reiserfs_filsys_t , const struct reiserfs_key *key,
|
||||
struct reiserfs_path *path);
|
||||
int reiserfs_search_by_entry_key(reiserfs_filsys_t , struct reiserfs_key *key,
|
||||
int reiserfs_search_by_entry_key(reiserfs_filsys_t,
|
||||
const struct reiserfs_key *key,
|
||||
struct reiserfs_path *path);
|
||||
int reiserfs_search_by_position(reiserfs_filsys_t , struct reiserfs_key *key,
|
||||
int version, struct reiserfs_path *path);
|
||||
@@ -160,6 +161,29 @@ void badblock_list(reiserfs_filsys_t fs, badblock_func_t action, void *data);
|
||||
#define reiserfs_bmap_nr(count, blk_size) ((count - 1) / (blk_size * 8) + 1)
|
||||
#define reiserfs_bmap_over(nr) (nr > ((1LL << 16) - 1))
|
||||
|
||||
typedef int (*reiserfs_file_iterate_indirect_fn)(reiserfs_filsys_t fs,
|
||||
__u64 position, __u64 size,
|
||||
int num_blocks, __u32 *blocks,
|
||||
void *data);
|
||||
typedef int (*reiserfs_file_iterate_direct_fn)(reiserfs_filsys_t fs,
|
||||
__u64 position, __u64 size,
|
||||
const char *body, size_t len,
|
||||
void *data);
|
||||
int reiserfs_iterate_file_data(reiserfs_filsys_t fs,
|
||||
const struct reiserfs_key const *short_key,
|
||||
reiserfs_file_iterate_indirect_fn indirect_fn,
|
||||
reiserfs_file_iterate_direct_fn direct_fn,
|
||||
void *data);
|
||||
|
||||
typedef int (*reiserfs_iterate_dir_fn)(reiserfs_filsys_t fs,
|
||||
const struct reiserfs_key const *dir_short_key,
|
||||
const char *name, size_t len,
|
||||
__u32 deh_dirid, __u32 deh_objectid, void *data);
|
||||
int reiserfs_iterate_dir(reiserfs_filsys_t fs,
|
||||
const struct reiserfs_key const *dir_short_key,
|
||||
const reiserfs_iterate_dir_fn callback, void *data);
|
||||
|
||||
|
||||
extern struct reiserfs_key root_dir_key;
|
||||
extern struct reiserfs_key parent_root_dir_key;
|
||||
extern struct reiserfs_key lost_found_dir_key;
|
||||
|
||||
Reference in new issue
Block a user