All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>, reiserfs-dev@namesys.com
Cc: linux-kernel@vger.kernel.org
Subject: [-mm patch] fs/reiser4/: more possible cleanups
Date: Sat, 25 Nov 2006 20:21:04 +0100	[thread overview]
Message-ID: <20061125192104.GM3702@stusta.de> (raw)
In-Reply-To: <20061123021703.8550e37e.akpm@osdl.org>

This patch contains the following possible cleanups:
- make needlessly global functions static
- #if 0 unused functions
- #if REISER4_DEBUG functions that are only used with debugging enabled

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 fs/reiser4/coord.c                |    8 ++----
 fs/reiser4/debug.c                |    6 ++++
 fs/reiser4/debug.h                |    4 ---
 fs/reiser4/plugin/cluster.h       |    8 ------
 fs/reiser4/plugin/item/ctail.c    |   10 ++++++-
 fs/reiser4/plugin/item/ctail.h    |    1 
 fs/reiser4/plugin/item/internal.c |    4 +++
 fs/reiser4/plugin/item/item.c     |    4 +++
 fs/reiser4/super.c                |    4 +++
 fs/reiser4/txnmgr.c               |   40 ++++++++++++++++--------------
 fs/reiser4/txnmgr.h               |    6 ----
 11 files changed, 52 insertions(+), 43 deletions(-)

--- linux-2.6.19-rc6-mm1/fs/reiser4/debug.h.old	2006-11-25 02:02:17.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/debug.h	2006-11-25 02:02:25.000000000 +0100
@@ -223,10 +223,6 @@
 extern void reiser4_do_panic(const char *format, ...)
     __attribute__ ((noreturn, format(printf, 1, 2)));
 
-extern void reiser4_print_prefix(const char *level, int reperr, const char *mid,
-				 const char *function,
-				 const char *file, int lineno);
-
 extern int reiser4_preempt_point(void);
 extern void reiser4_print_stats(void);
 
--- linux-2.6.19-rc6-mm1/fs/reiser4/debug.c.old	2006-11-25 02:02:33.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/debug.c	2006-11-25 02:45:37.000000000 +0100
@@ -40,11 +40,13 @@
 #include <linux/sysctl.h>
 #include <linux/hardirq.h>
 
+#if 0
 #if REISER4_DEBUG
 static void reiser4_report_err(void);
 #else
 #define reiser4_report_err() noop
 #endif
+#endif  /*  0  */
 
 /*
  * global buffer where message given to reiser4_panic is formatted.
@@ -95,6 +97,7 @@
 	panic("%s", panic_buf);
 }
 
+#if 0
 void
 reiser4_print_prefix(const char *level, int reperr, const char *mid,
 		     const char *function, const char *file, int lineno)
@@ -114,6 +117,7 @@
 	if (reperr)
 		reiser4_report_err();
 }
+#endif  /*  0  */
 
 /* Preemption point: this should be called periodically during long running
    operations (carry, allocate, and squeeze are best examples) */
@@ -258,6 +262,7 @@
 	}
 }
 
+#if 0
 /*
  * report error information recorder by reiser4_return_err().
  */
@@ -272,6 +277,7 @@
 		}
 	}
 }
+#endif  /*  0  */
 
 #endif				/* REISER4_DEBUG */
 
--- linux-2.6.19-rc6-mm1/fs/reiser4/plugin/cluster.h.old	2006-11-25 02:06:24.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/plugin/cluster.h	2006-11-25 02:49:53.000000000 +0100
@@ -226,14 +226,6 @@
 	return hint->ext_coord.extension.ctail.shift;
 }
 
-static inline void dclust_set_extension_shift(hint_t * hint)
-{
-	assert("edward-1270",
-	       item_id_by_coord(&hint->ext_coord.coord) == CTAIL_ID);
-	hint->ext_coord.extension.ctail.shift =
-	    cluster_shift_by_coord(&hint->ext_coord.coord);
-}
-
 static inline int hint_is_unprepped_dclust(hint_t * hint)
 {
 	assert("edward-1451", hint_is_valid(hint));
--- linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/ctail.h.old	2006-11-25 02:10:13.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/ctail.h	2006-11-25 02:10:21.000000000 +0100
@@ -78,7 +78,6 @@
 int scan_ctail(flush_scan *);
 int convert_ctail(flush_pos_t *);
 size_t inode_scaled_cluster_size(struct inode *);
-int cluster_shift_by_coord(const coord_t * coord);
 
 #endif				/* __FS_REISER4_CTAIL_H__ */
 
--- linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/ctail.c.old	2006-11-25 02:06:45.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/ctail.c	2006-11-25 02:50:04.000000000 +0100
@@ -45,11 +45,19 @@
 	return item_body_by_coord(coord);
 }
 
-int cluster_shift_by_coord(const coord_t * coord)
+static int cluster_shift_by_coord(const coord_t * coord)
 {
 	return get_unaligned(&ctail_formatted_at(coord)->cluster_shift);
 }
 
+static inline void dclust_set_extension_shift(hint_t * hint)
+{
+	assert("edward-1270",
+	       item_id_by_coord(&hint->ext_coord.coord) == CTAIL_ID);
+	hint->ext_coord.extension.ctail.shift =
+	    cluster_shift_by_coord(&hint->ext_coord.coord);
+}
+
 static loff_t off_by_coord(const coord_t * coord)
 {
 	reiser4_key key;
--- linux-2.6.19-rc6-mm1/fs/reiser4/txnmgr.h.old	2006-11-25 02:12:19.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/txnmgr.h	2006-11-25 02:17:18.000000000 +0100
@@ -695,12 +695,6 @@
 void protected_jnodes_done(protected_jnodes * list);
 void reiser4_invalidate_list(struct list_head * head);
 
-#if REISER4_DEBUG
-void reiser4_info_atom(const char *prefix, const txn_atom * atom);
-#else
-#define reiser4_info_atom(p,a) noop
-#endif
-
 # endif				/* __REISER4_TXNMGR_H__ */
 
 /* Make Linus happy.
--- linux-2.6.19-rc6-mm1/fs/reiser4/txnmgr.c.old	2006-11-25 02:12:32.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/txnmgr.c	2006-11-25 02:17:20.000000000 +0100
@@ -977,6 +977,28 @@
 	return current_atom_finish_all_fq();
 }
 
+#if REISER4_DEBUG
+
+static void reiser4_info_atom(const char *prefix, const txn_atom * atom)
+{
+	if (atom == NULL) {
+		printk("%s: no atom\n", prefix);
+		return;
+	}
+
+	printk("%s: refcount: %i id: %i flags: %x txnh_count: %i"
+	       " capture_count: %i stage: %x start: %lu, flushed: %i\n", prefix,
+	       atomic_read(&atom->refcount), atom->atom_id, atom->flags,
+	       atom->txnh_count, atom->capture_count, atom->stage,
+	       atom->start_time, atom->flushed);
+}
+
+#else  /*  REISER4_DEBUG  */
+
+static inline void reiser4_info_atom(const char *prefix, const txn_atom * atom) {}
+
+#endif  /*  REISER4_DEBUG  */
+
 #define TOOMANYFLUSHES (1 << 13)
 
 /* Called with the atom locked and no open "active" transaction handlers except
@@ -3094,24 +3116,6 @@
 	ON_DEBUG(count_jnode(atom, node, NODE_LIST(node), OVRWR_LIST, 1));
 }
 
-#if REISER4_DEBUG
-
-void reiser4_info_atom(const char *prefix, const txn_atom * atom)
-{
-	if (atom == NULL) {
-		printk("%s: no atom\n", prefix);
-		return;
-	}
-
-	printk("%s: refcount: %i id: %i flags: %x txnh_count: %i"
-	       " capture_count: %i stage: %x start: %lu, flushed: %i\n", prefix,
-	       atomic_read(&atom->refcount), atom->atom_id, atom->flags,
-	       atom->txnh_count, atom->capture_count, atom->stage,
-	       atom->start_time, atom->flushed);
-}
-
-#endif
-
 static int count_deleted_blocks_actor(txn_atom * atom,
 				      const reiser4_block_nr * a,
 				      const reiser4_block_nr * b, void *data)
--- linux-2.6.19-rc6-mm1/fs/reiser4/coord.c.old	2006-11-25 17:06:59.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/coord.c	2006-11-25 17:09:03.000000000 +0100
@@ -568,11 +568,6 @@
 }
 
 #if REISER4_DEBUG
-#define DEBUG_COORD_FIELDS (sizeof(c1->plug_v) + sizeof(c1->body_v))
-#else
-#define DEBUG_COORD_FIELDS (0)
-#endif
-
 int coords_equal(const coord_t * c1, const coord_t * c2)
 {
 	assert("nikita-2840", c1 != NULL);
@@ -583,6 +578,7 @@
 	    c1->item_pos == c2->item_pos &&
 	    c1->unit_pos == c2->unit_pos && c1->between == c2->between;
 }
+#endif  /*  REISER4_DEBUG  */
 
 /* If coord_is_after_rightmost return NCOORD_ON_THE_RIGHT, if coord_is_after_leftmost
    return NCOORD_ON_THE_LEFT, otherwise return NCOORD_INSIDE. */
@@ -683,6 +679,7 @@
 	return 0;
 }
 
+#if REISER4_DEBUG
 /* Returns true if the coordinates are positioned at adjacent units, regardless of
    before-after or item boundaries. */
 int coord_are_neighbors(coord_t * c1, coord_t * c2)
@@ -721,6 +718,7 @@
 		return 0;
 	}
 }
+#endif  /*  REISER4_DEBUG  */
 
 /* Assuming two coordinates are positioned in the same node, return COORD_CMP_ON_RIGHT,
    COORD_CMP_ON_LEFT, or COORD_CMP_SAME depending on c1's position relative to c2.  */
--- linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/internal.c.old	2006-11-25 17:11:50.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/internal.c	2006-11-25 17:30:51.000000000 +0100
@@ -144,6 +144,8 @@
 	return 0;
 }
 
+#if REISER4_DEBUG
+
 static void check_link(znode * left, znode * right)
 {
 	znode *scan;
@@ -209,6 +211,8 @@
 	return 0;
 }
 
+#endif  /*  REISER4_DEBUG  */
+
 /* return true only if this item really points to "block" */
 /* Audited by: green(2002.06.14) */
 int has_pointer_to_internal(const coord_t * coord /* coord of item */ ,
--- linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/item.c.old	2006-11-25 17:12:59.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/plugin/item/item.c	2006-11-25 17:15:11.000000000 +0100
@@ -271,6 +271,8 @@
 	return item_id_by_coord(item) == FORMATTING_ID;
 }
 
+#if REISER4_DEBUG
+
 int item_is_statdata(const coord_t * item)
 {
 	assert("vs-516", coord_is_existing_item(item));
@@ -283,6 +285,8 @@
 	return item_id_by_coord(item) == CTAIL_ID;
 }
 
+#endif  /*  REISER4_DEBUG  */
+
 static int change_item(struct inode *inode,
 		       reiser4_plugin * plugin,
 		       pset_member memb)
--- linux-2.6.19-rc6-mm1/fs/reiser4/super.c.old	2006-11-25 17:19:27.000000000 +0100
+++ linux-2.6.19-rc6-mm1/fs/reiser4/super.c	2006-11-25 17:36:54.000000000 +0100
@@ -47,6 +47,7 @@
 	return get_super_private(super)->block_count;
 }
 
+#if REISER4_DEBUG
 /*
  * number of blocks in the current file system
  */
@@ -54,6 +55,7 @@
 {
 	return get_current_super_private()->block_count;
 }
+#endif  /*  REISER4_DEBUG  */
 
 /* set number of block in filesystem */
 void reiser4_set_block_count(const struct super_block *super, __u64 nr)
@@ -293,6 +295,7 @@
 	return *blk < sbinfo->block_count;
 }
 
+#if REISER4_DEBUG
 /*
  * true, if block number @blk makes sense for the current file system
  */
@@ -300,6 +303,7 @@
 {
 	return reiser4_blocknr_is_sane_for(reiser4_get_current_sb(), blk);
 }
+#endif  /*  REISER4_DEBUG  */
 
 /* Make Linus happy.
    Local variables:


  parent reply	other threads:[~2006-11-25 19:21 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-23 10:17 2.6.19-rc6-mm1 Andrew Morton
2006-11-23 10:38 ` 2.6.19-rc6-mm1 Reuben Farrelly
2006-11-23 14:06   ` [PATCH] x86_64: fix build without HOTPLUG_CPU (was Re: 2.6.19-rc6-mm1) Jiri Kosina
2006-11-23 15:08     ` Andi Kleen
2006-11-23 15:17       ` Jiri Kosina
2006-11-23 15:27         ` Andi Kleen
2006-11-23 15:37           ` Jiri Kosina
2006-11-23 16:33             ` Ingo Molnar
2006-11-23 11:23 ` 2.6.19-rc6-mm1 Mariusz Kozlowski
2006-11-23 18:36   ` 2.6.19-rc6-mm1 Andrew Morton
2006-11-23 19:24     ` 2.6.19-rc6-mm1 Mariusz Kozlowski
2006-11-23 20:20     ` 2.6.19-rc6-mm1 Andy Whitcroft
2006-11-23 20:56       ` 2.6.19-rc6-mm1 Andrew Morton
2006-11-24 19:34       ` 2.6.19-rc6-mm1 Matthew Frost
2006-11-23 20:23     ` 2.6.19-rc6-mm1 Benoit Boissinot
2006-11-23 12:22 ` 2.6.19-rc6-mm1 Mariusz Kozlowski
2006-11-23 13:03 ` 2.6.19-rc6-mm1 Andy Whitcroft
2006-11-23 17:26 ` MCORE2 include/asm/module.h:60:2: error: #error unknown processor family [was Re: 2.6.19-rc6-mm1] Mattia Dongili
2006-11-23 23:30 ` 2.6.19-rc6-mm1: no help text for TCP_MD5SIG_DEBUG Adrian Bunk
2006-11-24  1:37   ` David Miller
2006-11-24  0:17 ` 2.6.19-rc6-mm1: drivers/net/chelsio/: unused code Adrian Bunk
2006-11-27 18:24   ` Stephen Hemminger
2006-11-29  7:36     ` Adrian Bunk
2006-11-29  7:47       ` Andrew Morton
2007-02-20  0:02         ` Adrian Bunk
2007-02-20 21:31           ` Stephen Hemminger
2007-02-20 22:06             ` Adrian Bunk
2006-11-24  1:46 ` [-mm patch] make qla2x00_reg_remote_port() static Adrian Bunk
2006-11-27 17:22   ` Andrew Vasquez
2006-11-24  1:46 ` [-mm patch] make proc_pid_io_accounting() static Adrian Bunk
2006-11-24  1:46 ` [-mm patch] make readahead_debug_level static Adrian Bunk
2006-11-24 16:59 ` [PATCH] efi_limit_regions triggers link failure when CONFIG_EFI is not defined Andy Whitcroft
2006-11-24 17:05   ` Andi Kleen
2006-11-24 17:24     ` Andy Whitcroft
2006-11-24 17:33       ` Andi Kleen
2006-11-24 21:30         ` Andrew Morton
2006-11-26  2:13     ` Matthew Frost
2006-11-24 17:58 ` [PATCH] x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled Andy Whitcroft
2006-11-24 18:03   ` Jiri Kosina
2006-11-24 19:11   ` Andi Kleen
2006-11-24 21:58 ` [-mm patch] net/: possible cleanups Adrian Bunk
2006-12-01  1:28   ` David Miller
2006-11-25 19:15 ` [-mm patch] include/linux/bug.h must always #include <linux/module.h> Adrian Bunk
2006-11-25 19:17 ` [-mm patch] fs/stack.c should #include <linux/fs_stack.h> Adrian Bunk
2006-11-25 19:57   ` Josef Sipek
2006-11-25 19:21 ` Adrian Bunk [this message]
2006-11-25 19:48 ` 2.6.19-rc6-mm1 -- sched-improve-migration-accuracy.patch slows boot Don Mullis
2006-11-26  6:24   ` Mike Galbraith
2006-11-27  1:38     ` Don Mullis
2006-11-27 10:16       ` Ingo Molnar
2006-11-28 18:47         ` Don Mullis
2006-11-27 10:50       ` [patch] " Mike Galbraith
2006-11-27 17:17         ` Don Mullis
2006-11-27 18:27           ` Mike Galbraith
2006-11-26  5:40 ` [-mm patch] sound/soc/soc-dapm.c: make 4 functions static Adrian Bunk
2006-11-27  4:21 ` [PATCH] paravirt reorder functions to avoid unspecified behaviour Andy Whitcroft
2006-11-27 11:13   ` Andi Kleen

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=20061125192104.GM3702@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-dev@namesys.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.