aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-03 06:45:09 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 03:54:33 -0400
commit83cef708c606f46a2b527af025acb3d24555f0c4 (patch)
treef5f91da8f13a7f013304ae596e56e7d52a5dcd76 /fs/ubifs/debug.h
parentd033c98b17ecf30d64d83d96938ce7bfb47f7520 (diff)
UBIFS: introduce more I/O helpers
Introduce the following I/O helper functions: 'ubifs_leb_read()', 'ubifs_leb_write()', 'ubifs_leb_change()', 'ubifs_leb_unmap()', 'ubifs_leb_map()', 'ubifs_is_mapped(). The idea is to wrap all UBI I/O functions in order to encapsulate various assertions and error path handling (error message, stack dump, switching to R/O mode). And there are some other benefits of this which will be used in the following patches. This patch does not switch whole UBIFS to use these functions yet. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.h')
-rw-r--r--fs/ubifs/debug.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index e1dcfd29c9aa..b0b005b97279 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -244,6 +244,10 @@ static inline int dbg_is_tst_rcvry(const struct ubifs_info *c)
244{ 244{
245 return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry); 245 return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry);
246} 246}
247static inline int dbg_is_power_cut(const struct ubifs_info *c)
248{
249 return !!c->dbg->failure_mode;
250}
247 251
248int ubifs_debugging_init(struct ubifs_info *c); 252int ubifs_debugging_init(struct ubifs_info *c);
249void ubifs_debugging_exit(struct ubifs_info *c); 253void ubifs_debugging_exit(struct ubifs_info *c);
@@ -445,12 +449,24 @@ static inline int
445dbg_check_nondata_nodes_order(struct ubifs_info *c, 449dbg_check_nondata_nodes_order(struct ubifs_info *c,
446 struct list_head *head) { return 0; } 450 struct list_head *head) { return 0; }
447 451
452static inline int dbg_leb_write(struct ubi_volume_desc *desc,
453 int lnum, const void *buf,
454 int offset, int len, int dtype) { return 0; }
455static inline int dbg_leb_change(struct ubi_volume_desc *desc,
456 int lnum, const void *buf,
457 int len, int dtype) { return 0; }
458static inline int dbg_leb_unmap(struct ubi_volume_desc *desc,
459 int lnum) { return 0; }
460static inline int dbg_leb_map(struct ubi_volume_desc *desc,
461 int lnum, int dtype) { return 0; }
462
448static inline int dbg_is_chk_gen(const struct ubifs_info *c) { return 0; } 463static inline int dbg_is_chk_gen(const struct ubifs_info *c) { return 0; }
449static inline int dbg_is_chk_index(const struct ubifs_info *c) { return 0; } 464static inline int dbg_is_chk_index(const struct ubifs_info *c) { return 0; }
450static inline int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; } 465static inline int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; }
451static inline int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; } 466static inline int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; }
452static inline int dbg_is_chk_fs(const struct ubifs_info *c) { return 0; } 467static inline int dbg_is_chk_fs(const struct ubifs_info *c) { return 0; }
453static inline int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; } 468static inline int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; }
469static inline int dbg_is_power_cut(const struct ubifs_info *c) { return 0; }
454 470
455static inline int dbg_debugfs_init(void) { return 0; } 471static inline int dbg_debugfs_init(void) { return 0; }
456static inline void dbg_debugfs_exit(void) { return; } 472static inline void dbg_debugfs_exit(void) { return; }