linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH 21/30] UBIFS: remove unused and unneeded debugging function
Date: Thu,  9 Jun 2011 12:05:01 +0300	[thread overview]
Message-ID: <1307610310-28691-22-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1307610310-28691-1-git-send-email-dedekind1@gmail.com>

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

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>
---
 fs/ubifs/debug.c |   33 ++-------------------------------
 fs/ubifs/debug.h |   27 +--------------------------
 2 files changed, 3 insertions(+), 57 deletions(-)

diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 741f939..a159cfd 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2718,16 +2718,8 @@ static void cut_data(const void *buf, int len)
 		p[i] = 0xff;
 }
 
-int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
-		 int len, int check)
-{
-	if (in_failure_mode(desc))
-		return -EROFS;
-	return ubi_leb_read(desc, lnum, buf, offset, len, check);
-}
-
 int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
-		  int offset, int len, int dtype)
+		  int offs, int len, int dtype)
 {
 	int err, failing;
 
@@ -2736,7 +2728,7 @@ int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
 	failing = do_fail(desc, lnum, 1);
 	if (failing)
 		cut_data(buf, len);
-	err = ubi_leb_write(desc, lnum, buf, offset, len, dtype);
+	err = ubi_leb_write(desc, lnum, buf, offs, len, dtype);
 	if (err)
 		return err;
 	if (failing)
@@ -2759,20 +2751,6 @@ int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
 	return 0;
 }
 
-int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum)
-{
-	int err;
-
-	if (do_fail(desc, lnum, 0))
-		return -EROFS;
-	err = ubi_leb_erase(desc, lnum);
-	if (err)
-		return err;
-	if (do_fail(desc, lnum, 0))
-		return -EROFS;
-	return 0;
-}
-
 int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
 {
 	int err;
@@ -2787,13 +2765,6 @@ int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
 	return 0;
 }
 
-int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum)
-{
-	if (in_failure_mode(desc))
-		return -EROFS;
-	return ubi_is_mapped(desc, lnum);
-}
-
 int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype)
 {
 	int err;
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 43ec5d1..e1dcfd2 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);
 int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);
 
 #ifndef UBIFS_DBG_PRESERVE_UBI
-#define ubi_leb_read   dbg_leb_read
 #define ubi_leb_write  dbg_leb_write
 #define ubi_leb_change dbg_leb_change
-#define ubi_leb_erase  dbg_leb_erase
 #define ubi_leb_unmap  dbg_leb_unmap
-#define ubi_is_mapped  dbg_is_mapped
 #define ubi_leb_map    dbg_leb_map
 #endif
 
-int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
-		 int len, int check);
 int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
-		  int offset, int len, int dtype);
+		  int offs, int len, int dtype);
 int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
 		   int len, int dtype);
-int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum);
 int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum);
-int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum);
 int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
 
-static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
-			   int offset, int len)
-{
-	return dbg_leb_read(desc, lnum, buf, offset, len, 0);
-}
-
-static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
-			    const void *buf, int offset, int len)
-{
-	return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
-}
-
-static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
-				    const void *buf, int len)
-{
-	return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
-}
-
 /* Debugfs-related stuff */
 int dbg_debugfs_init(void);
 void dbg_debugfs_exit(void);
-- 
1.7.2.3

  parent reply	other threads:[~2011-06-09  9:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  9:04 [PATCH 00/30] UBIFS: latest patches Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 01/30] UBIFS: return EROFS in case of broken commit Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 02/30] UBIFS: lessen the size of debugging info data structure Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 03/30] UBIFS: dump stack when pnode or nnode reading fails Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 04/30] UBIFS: improve inode dumping function Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 05/30] UBIFS: rename dbg_check_dir_size function Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 06/30] UBIFS: minor cleanup: use S_ISREG helper Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 07/30] UBIFS: remove unnecessary brackets Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 08/30] UBIFS: remove dead code Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 09/30] UBIFS: harmonize znode flag helpers Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 10/30] UBIFS: use correct flags in lprops Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 11/30] UBIFS: add few commentaries about TNC Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 12/30] UBIFS: amend debugging name check function prototype Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 13/30] UBIFS: amend debugging inode size " Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 14/30] UBIFS: introduce helper functions for debugging checks and tests Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 15/30] UBIFS: lessen amount of debugging check types Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 16/30] UBIFS: switch self-check knobs to debugfs Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 17/30] UBIFS: be more informative in failure mode Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 18/30] UBIFS: re-arrange debugging code a bit Artem Bityutskiy
2011-06-09  9:04 ` [PATCH 19/30] UBIFS: introduce debugfs helpers Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 20/30] UBIFS: add global debugfs knobs Artem Bityutskiy
2011-06-09  9:05 ` Artem Bityutskiy [this message]
2011-06-09  9:05 ` [PATCH 22/30] UBIFS: always print stacktrace when switching to R/O mode Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 23/30] UBIFS: introduce more I/O helpers Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 24/30] UBIFS: switch to ubifs_leb_read Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 25/30] UBIFS: switch to ubifs_leb_write Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 26/30] UBIFS: switch to I/O helpers Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 27/30] UBIFS: stop re-defining UBI operations Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 28/30] UBIFS: remove custom list of superblocks Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 29/30] UBIFS: rename recovery testing variables Artem Bityutskiy
2011-06-09  9:05 ` [PATCH 30/30] UBIFS: improve power cut emulation testing Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307610310-28691-22-git-send-email-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).