aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/recovery.c
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/recovery.c
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/recovery.c')
-rw-r--r--fs/ubifs/recovery.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 783d8e0beb76..c59154980719 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -919,8 +919,7 @@ struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
919 * 919 *
920 * This function returns %0 on success and a negative error code on failure. 920 * This function returns %0 on success and a negative error code on failure.
921 */ 921 */
922static int recover_head(const struct ubifs_info *c, int lnum, int offs, 922static int recover_head(struct ubifs_info *c, int lnum, int offs, void *sbuf)
923 void *sbuf)
924{ 923{
925 int len = c->max_write_size, err; 924 int len = c->max_write_size, err;
926 925
@@ -962,7 +961,7 @@ static int recover_head(const struct ubifs_info *c, int lnum, int offs,
962 * 961 *
963 * This function returns %0 on success and a negative error code on failure. 962 * This function returns %0 on success and a negative error code on failure.
964 */ 963 */
965int ubifs_recover_inl_heads(const struct ubifs_info *c, void *sbuf) 964int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf)
966{ 965{
967 int err; 966 int err;
968 967
@@ -993,7 +992,7 @@ int ubifs_recover_inl_heads(const struct ubifs_info *c, void *sbuf)
993 * 992 *
994 * This function returns %0 on success and a negative error code on failure. 993 * This function returns %0 on success and a negative error code on failure.
995 */ 994 */
996static int clean_an_unclean_leb(const struct ubifs_info *c, 995static int clean_an_unclean_leb(struct ubifs_info *c,
997 struct ubifs_unclean_leb *ucleb, void *sbuf) 996 struct ubifs_unclean_leb *ucleb, void *sbuf)
998{ 997{
999 int err, lnum = ucleb->lnum, offs = 0, len = ucleb->endpt, quiet = 1; 998 int err, lnum = ucleb->lnum, offs = 0, len = ucleb->endpt, quiet = 1;
@@ -1089,7 +1088,7 @@ static int clean_an_unclean_leb(const struct ubifs_info *c,
1089 * 1088 *
1090 * This function returns %0 on success and a negative error code on failure. 1089 * This function returns %0 on success and a negative error code on failure.
1091 */ 1090 */
1092int ubifs_clean_lebs(const struct ubifs_info *c, void *sbuf) 1091int ubifs_clean_lebs(struct ubifs_info *c, void *sbuf)
1093{ 1092{
1094 dbg_rcvry("recovery"); 1093 dbg_rcvry("recovery");
1095 while (!list_empty(&c->unclean_leb_list)) { 1094 while (!list_empty(&c->unclean_leb_list)) {