1 |
1628 |
jcastillo |
/*
|
2 |
|
|
* JFFS -- Journalling Flash File System, Linux implementation.
|
3 |
|
|
*
|
4 |
|
|
* Copyright (C) 1999, 2000 Finn Hakansson, Axis Communications, Inc.
|
5 |
|
|
*
|
6 |
|
|
* This is free software; you can redistribute it and/or modify it
|
7 |
|
|
* under the terms of the GNU General Public License as published by
|
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
9 |
|
|
* (at your option) any later version.
|
10 |
|
|
*
|
11 |
|
|
* $Id: intrep.h,v 1.1 2005-12-20 10:26:13 jcastillo Exp $
|
12 |
|
|
*
|
13 |
|
|
*/
|
14 |
|
|
|
15 |
|
|
#ifndef __LINUX_JFFS_INTREP_H__
|
16 |
|
|
#define __LINUX_JFFS_INTREP_H__
|
17 |
|
|
|
18 |
|
|
void jffs_hexdump(const unsigned char* ptr, int size);
|
19 |
|
|
inline int jffs_min(int a, int b);
|
20 |
|
|
inline int jffs_max(int a, int b);
|
21 |
|
|
__u32 jffs_checksum(const void *data, int size);
|
22 |
|
|
|
23 |
|
|
void jffs_cleanup_control(struct jffs_control *c);
|
24 |
|
|
int jffs_build_fs(struct super_block *sb);
|
25 |
|
|
|
26 |
|
|
int jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
|
27 |
|
|
const struct jffs_raw_inode *raw_inode,
|
28 |
|
|
const char *name, struct jffs_node *node);
|
29 |
|
|
struct jffs_file *jffs_find_file(struct jffs_control *c, __u32 ino);
|
30 |
|
|
struct jffs_file *jffs_find_child(struct jffs_file *dir, const char *name, int len);
|
31 |
|
|
|
32 |
|
|
void jffs_free_node(struct jffs_node *node);
|
33 |
|
|
|
34 |
|
|
int jffs_foreach_file(struct jffs_control *c, int (*func)(struct jffs_file *));
|
35 |
|
|
int jffs_free_node_list(struct jffs_file *f);
|
36 |
|
|
int jffs_possibly_delete_file(struct jffs_file *f);
|
37 |
|
|
int jffs_build_file(struct jffs_file *f);
|
38 |
|
|
int jffs_insert_file_into_hash(struct jffs_file *f);
|
39 |
|
|
int jffs_insert_file_into_tree(struct jffs_file *f);
|
40 |
|
|
int jffs_unlink_file_from_hash(struct jffs_file *f);
|
41 |
|
|
int jffs_unlink_file_from_tree(struct jffs_file *f);
|
42 |
|
|
int jffs_remove_redundant_nodes(struct jffs_file *f);
|
43 |
|
|
int jffs_file_count(struct jffs_file *f);
|
44 |
|
|
|
45 |
|
|
int jffs_write_node(struct jffs_control *c, struct jffs_node *node,
|
46 |
|
|
struct jffs_raw_inode *raw_inode,
|
47 |
|
|
const char *name, const unsigned char *buf);
|
48 |
|
|
int jffs_read_data(struct jffs_file *f, char *buf, __u32 read_offset, __u32 size);
|
49 |
|
|
|
50 |
|
|
/* Garbage collection stuff. */
|
51 |
|
|
int jffs_garbage_collect(struct jffs_control *c);
|
52 |
|
|
|
53 |
|
|
/* For debugging purposes. */
|
54 |
|
|
void jffs_print_node(struct jffs_node *n);
|
55 |
|
|
void jffs_print_raw_inode(struct jffs_raw_inode *raw_inode);
|
56 |
|
|
int jffs_print_file(struct jffs_file *f);
|
57 |
|
|
void jffs_print_hash_table(struct jffs_control *c);
|
58 |
|
|
void jffs_print_tree(struct jffs_file *first_file, int indent);
|
59 |
|
|
|
60 |
|
|
struct buffer_head *jffs_get_write_buffer(kdev_t dev, int block);
|
61 |
|
|
void jffs_put_write_buffer(struct buffer_head *bh);
|
62 |
|
|
|
63 |
|
|
#endif /* __LINUX_JFFS_INTREP_H__ */
|