From 83cef708c606f46a2b527af025acb3d24555f0c4 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 3 Jun 2011 13:45:09 +0300 Subject: 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 --- fs/ubifs/debug.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'fs/ubifs/debug.h') diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index e1dcfd2..b0b005b 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) { return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry); } +static inline int dbg_is_power_cut(const struct ubifs_info *c) +{ + return !!c->dbg->failure_mode; +} int ubifs_debugging_init(struct ubifs_info *c); void ubifs_debugging_exit(struct ubifs_info *c); @@ -445,12 +449,24 @@ static inline int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head) { return 0; } +static inline int dbg_leb_write(struct ubi_volume_desc *desc, + int lnum, const void *buf, + int offset, int len, int dtype) { return 0; } +static inline int dbg_leb_change(struct ubi_volume_desc *desc, + int lnum, const void *buf, + int len, int dtype) { return 0; } +static inline int dbg_leb_unmap(struct ubi_volume_desc *desc, + int lnum) { return 0; } +static inline int dbg_leb_map(struct ubi_volume_desc *desc, + int lnum, int dtype) { return 0; } + static inline int dbg_is_chk_gen(const struct ubifs_info *c) { return 0; } static inline int dbg_is_chk_index(const struct ubifs_info *c) { return 0; } static inline int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; } static inline int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; } static inline int dbg_is_chk_fs(const struct ubifs_info *c) { return 0; } static inline int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; } +static inline int dbg_is_power_cut(const struct ubifs_info *c) { return 0; } static inline int dbg_debugfs_init(void) { return 0; } static inline void dbg_debugfs_exit(void) { return; } -- cgit v1.1