aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-03 04:32:21 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 03:54:32 -0400
commit891a54a153646f9b16bffe5df6cb74cb3f1e9dc6 (patch)
treee61849c41a6301e6bfb757ec043b9debc5160963 /fs/ubifs
parente7717060ddd509e6c305ad7bf5a090a95e91c8cf (diff)
UBIFS: remove unused and unneeded debugging function
This patch contains several minor clean-up and preparational cahnges. 1. Remove 'dbg_read()', 'dbg_write()', 'dbg_change()', and 'dbg_leb_erase()' functions as they are not used. 2. Remove 'dbg_leb_read()' and 'dbg_is_mapped()' as they are not really needed, it is fine to let reads go through in failure mode. 3. Rename 'offset' argument to 'offs' to be consistent with the rest of UBIFS code. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/debug.c33
-rw-r--r--fs/ubifs/debug.h27
2 files changed, 3 insertions, 57 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 15bec635bf3e..059c586b5ef8 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2718,16 +2718,8 @@ static void cut_data(const void *buf, int len)
2718 p[i] = 0xff; 2718 p[i] = 0xff;
2719} 2719}
2720 2720
2721int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
2722 int len, int check)
2723{
2724 if (in_failure_mode(desc))
2725 return -EROFS;
2726 return ubi_leb_read(desc, lnum, buf, offset, len, check);
2727}
2728
2729int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, 2721int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
2730 int offset, int len, int dtype) 2722 int offs, int len, int dtype)
2731{ 2723{
2732 int err, failing; 2724 int err, failing;
2733 2725
@@ -2736,7 +2728,7 @@ int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
2736 failing = do_fail(desc, lnum, 1); 2728 failing = do_fail(desc, lnum, 1);
2737 if (failing) 2729 if (failing)
2738 cut_data(buf, len); 2730 cut_data(buf, len);
2739 err = ubi_leb_write(desc, lnum, buf, offset, len, dtype); 2731 err = ubi_leb_write(desc, lnum, buf, offs, len, dtype);
2740 if (err) 2732 if (err)
2741 return err; 2733 return err;
2742 if (failing) 2734 if (failing)
@@ -2759,20 +2751,6 @@ int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
2759 return 0; 2751 return 0;
2760} 2752}
2761 2753
2762int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum)
2763{
2764 int err;
2765
2766 if (do_fail(desc, lnum, 0))
2767 return -EROFS;
2768 err = ubi_leb_erase(desc, lnum);
2769 if (err)
2770 return err;
2771 if (do_fail(desc, lnum, 0))
2772 return -EROFS;
2773 return 0;
2774}
2775
2776int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum) 2754int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
2777{ 2755{
2778 int err; 2756 int err;
@@ -2787,13 +2765,6 @@ int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
2787 return 0; 2765 return 0;
2788} 2766}
2789 2767
2790int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum)
2791{
2792 if (in_failure_mode(desc))
2793 return -EROFS;
2794 return ubi_is_mapped(desc, lnum);
2795}
2796
2797int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype) 2768int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype)
2798{ 2769{
2799 int err; 2770 int err;
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 43ec5d120d7c..e1dcfd29c9aa 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -302,44 +302,19 @@ int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head);
302int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); 302int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);
303 303
304#ifndef UBIFS_DBG_PRESERVE_UBI 304#ifndef UBIFS_DBG_PRESERVE_UBI
305#define ubi_leb_read dbg_leb_read
306#define ubi_leb_write dbg_leb_write 305#define ubi_leb_write dbg_leb_write
307#define ubi_leb_change dbg_leb_change 306#define ubi_leb_change dbg_leb_change
308#define ubi_leb_erase dbg_leb_erase
309#define ubi_leb_unmap dbg_leb_unmap 307#define ubi_leb_unmap dbg_leb_unmap
310#define ubi_is_mapped dbg_is_mapped
311#define ubi_leb_map dbg_leb_map 308#define ubi_leb_map dbg_leb_map
312#endif 309#endif
313 310
314int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
315 int len, int check);
316int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, 311int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
317 int offset, int len, int dtype); 312 int offs, int len, int dtype);
318int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, 313int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
319 int len, int dtype); 314 int len, int dtype);
320int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum);
321int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum); 315int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum);
322int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum);
323int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); 316int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
324 317
325static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
326 int offset, int len)
327{
328 return dbg_leb_read(desc, lnum, buf, offset, len, 0);
329}
330
331static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
332 const void *buf, int offset, int len)
333{
334 return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
335}
336
337static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
338 const void *buf, int len)
339{
340 return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
341}
342
343/* Debugfs-related stuff */ 318/* Debugfs-related stuff */
344int dbg_debugfs_init(void); 319int dbg_debugfs_init(void);
345void dbg_debugfs_exit(void); 320void dbg_debugfs_exit(void);