diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-03 06:45:09 -0400 |
---|---|---|
committer | Artem Bityutskiy <dedekind1@gmail.com> | 2011-07-04 03:54:33 -0400 |
commit | 83cef708c606f46a2b527af025acb3d24555f0c4 (patch) | |
tree | f5f91da8f13a7f013304ae596e56e7d52a5dcd76 /fs/ubifs/ubifs.h | |
parent | d033c98b17ecf30d64d83d96938ce7bfb47f7520 (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/ubifs.h')
-rw-r--r-- | fs/ubifs/ubifs.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 3304aad04885..702b79258e30 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1468,6 +1468,15 @@ extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT]; | |||
1468 | 1468 | ||
1469 | /* io.c */ | 1469 | /* io.c */ |
1470 | void ubifs_ro_mode(struct ubifs_info *c, int err); | 1470 | void ubifs_ro_mode(struct ubifs_info *c, int err); |
1471 | int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs, | ||
1472 | int len, int even_ebadmsg); | ||
1473 | int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | ||
1474 | int len, int dtype); | ||
1475 | int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len, | ||
1476 | int dtype); | ||
1477 | int ubifs_leb_unmap(struct ubifs_info *c, int lnum); | ||
1478 | int ubifs_leb_map(struct ubifs_info *c, int lnum, int dtype); | ||
1479 | int ubifs_is_mapped(const struct ubifs_info *c, int lnum); | ||
1471 | int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len); | 1480 | int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len); |
1472 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, | 1481 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, |
1473 | int dtype); | 1482 | int dtype); |
@@ -1747,8 +1756,8 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, | |||
1747 | int offs, void *sbuf, int jhead); | 1756 | int offs, void *sbuf, int jhead); |
1748 | struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum, | 1757 | struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum, |
1749 | int offs, void *sbuf); | 1758 | int offs, void *sbuf); |
1750 | int ubifs_recover_inl_heads(const struct ubifs_info *c, void *sbuf); | 1759 | int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf); |
1751 | int ubifs_clean_lebs(const struct ubifs_info *c, void *sbuf); | 1760 | int ubifs_clean_lebs(struct ubifs_info *c, void *sbuf); |
1752 | int ubifs_rcvry_gc_commit(struct ubifs_info *c); | 1761 | int ubifs_rcvry_gc_commit(struct ubifs_info *c); |
1753 | int ubifs_recover_size_accum(struct ubifs_info *c, union ubifs_key *key, | 1762 | int ubifs_recover_size_accum(struct ubifs_info *c, union ubifs_key *key, |
1754 | int deletion, loff_t new_size); | 1763 | int deletion, loff_t new_size); |