intrep.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * JFFS -- Journaling Flash File System, Linux implementation.
  3. *
  4. * Copyright (C) 1999, 2000 Axis Communications AB.
  5. *
  6. * Created by Finn Hakansson <finn@axis.com>.
  7. *
  8. * This is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * $Id: intrep.h,v 1.14 2001/09/23 23:28:37 dwmw2 Exp $
  14. *
  15. */
  16. #ifndef __LINUX_JFFS_INTREP_H__
  17. #define __LINUX_JFFS_INTREP_H__
  18. #include "jffs_fm.h"
  19. struct jffs_node *jffs_alloc_node(void);
  20. void jffs_free_node(struct jffs_node *n);
  21. int jffs_get_node_inuse(void);
  22. void jffs_cleanup_control(struct jffs_control *c);
  23. int jffs_build_fs(struct super_block *sb);
  24. int jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
  25. const struct jffs_raw_inode *raw_inode,
  26. const char *name, struct jffs_node *node);
  27. struct jffs_file *jffs_find_file(struct jffs_control *c, __u32 ino);
  28. struct jffs_file *jffs_find_child(struct jffs_file *dir, const char *name, int len);
  29. void jffs_free_node(struct jffs_node *node);
  30. int jffs_foreach_file(struct jffs_control *c, int (*func)(struct jffs_file *));
  31. int jffs_possibly_delete_file(struct jffs_file *f);
  32. int jffs_insert_file_into_tree(struct jffs_file *f);
  33. int jffs_unlink_file_from_tree(struct jffs_file *f);
  34. int jffs_file_count(struct jffs_file *f);
  35. int jffs_write_node(struct jffs_control *c, struct jffs_node *node,
  36. struct jffs_raw_inode *raw_inode,
  37. const char *name, const unsigned char *buf,
  38. int recoverable, struct jffs_file *f);
  39. int jffs_read_data(struct jffs_file *f, unsigned char *buf, __u32 read_offset, __u32 size);
  40. /* Garbage collection stuff. */
  41. int jffs_garbage_collect_thread(void *c);
  42. void jffs_garbage_collect_trigger(struct jffs_control *c);
  43. /* For debugging purposes. */
  44. #if 0
  45. int jffs_print_file(struct jffs_file *f);
  46. #endif /* 0 */
  47. void jffs_print_hash_table(struct jffs_control *c);
  48. void jffs_print_tree(struct jffs_file *first_file, int indent);
  49. #endif /* __LINUX_JFFS_INTREP_H__ */