Re: [2.6.11-rc5-mm1 patch] fs/reiser4/: possible cleanups

2005-03-12 Thread Hans Reiser
vs, please review and respond in 2 weeks.  (vs is sick at the moment)

Thanks Adrian,

Hans

Adrian Bunk wrote:

>This patch contains possible cleanups including the following:
>- make needlessly global code static
>- plugin/compress/minilzo.c: many cleanups
>- remove or #if 0 the following unused global functions:
>  - context.c: check_contexts
>  - flush.c: jnode_tostring
>  - flush.c: znode_tostring
>  - flush.c: pos_tostring
>  - flush_queue.c: fq_by_jnode
>  - inode.c: get_reiser4_inode_by_key
>  - lock.c: lock_mode
>  - plugin/cryptcompress.c: set_nrpages_by_inode
>  - file.c: readpages_unix_file
>  - plugin/item/ctail.c: ctail_make_unprepped_cluster
>  - plugin/item/extent_item_ops.c: show_extent
>  - plugin/item/tail.c: show_tail
>  - tree_walk.c: tree_walk
>
>Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
>
>---
>
>This patch was already sent on:
>- 3 Mar 2005
>
> fs/reiser4/block_alloc.c |2 
> fs/reiser4/cluster.h |3 
> fs/reiser4/context.c |2 
> fs/reiser4/debug.c   |   13 +
> fs/reiser4/debug.h   |2 
> fs/reiser4/flush.c   |6 
> fs/reiser4/flush.h   |4 
> fs/reiser4/flush_queue.c |7 
> fs/reiser4/inode.c   |6 
> fs/reiser4/inode.h   |3 
> fs/reiser4/jnode.c   |8 -
> fs/reiser4/jnode.h   |2 
> fs/reiser4/lock.c|2 
> fs/reiser4/lock.h|1 
> fs/reiser4/page_cache.c  |2 
> fs/reiser4/plugin/compress/lzoconf.h |   23 --
> fs/reiser4/plugin/compress/minilzo.c |  179 +--
> fs/reiser4/plugin/cryptcompress.c|   15 -
> fs/reiser4/plugin/file/file.c|   14 -
> fs/reiser4/plugin/file/funcs.h   |2 
> fs/reiser4/plugin/item/ctail.c   |4 
> fs/reiser4/plugin/item/ctail.h   |1 
> fs/reiser4/plugin/item/extent.h  |1 
> fs/reiser4/plugin/item/extent_item_ops.c |2 
> fs/reiser4/plugin/item/tail.c|5 
> fs/reiser4/plugin/item/tail.h|1 
> fs/reiser4/plugin/object.c   |2 
> fs/reiser4/plugin/object.h   |1 
> fs/reiser4/tree_walk.c   |4 
> fs/reiser4/txnmgr.h  |1 
> fs/reiser4/vfs_ops.c |   14 -
> fs/reiser4/wander.c  |2 
> fs/reiser4/znode.c   |4 
> 33 files changed, 66 insertions(+), 272 deletions(-)
>
>--- linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c.old 2005-03-01 
>21:18:07.0 +0100
>+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c 2005-03-01 
>21:18:14.0 +0100
>@@ -932,7 +932,7 @@
> #if REISER4_DEBUG
> 
> /* check "allocated" state of given block range */
>-void
>+static void
> reiser4_check_blocks(const reiser4_block_nr * start, const reiser4_block_nr * 
> len, int desired)
> {
>   sa_check_blocks(start, len, desired);
>--- linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c.old 2005-03-01 
>21:18:31.0 +0100
>+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c 2005-03-01 
>21:19:08.0 +0100
>@@ -47,6 +47,7 @@
> /* lock protecting access to active_contexts. */
> spinlock_t active_contexts_lock;
> 
>+#if 0
> void
> check_contexts(void)
> {
>@@ -58,6 +59,7 @@
>   }
>   spin_unlock(&active_contexts_lock);
> }
>+#endif  /*  0  */
> 
> #endif /* REISER4_DEBUG */
> 
>--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h.old   2005-03-01 
>21:19:25.0 +0100
>+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h   2005-03-01 
>21:19:31.0 +0100
>@@ -176,8 +176,6 @@
>   REISER4_CHECK_NODE = 0x0008
> } reiser4_debug_flags;
> 
>-extern int reiser4_is_debugged(struct super_block *super, __u32 flag);
>-
> extern int is_in_reiser4_context(void);
> 
> /*
>--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c.old   2005-03-01 
>21:19:38.0 +0100
>+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c   2005-03-01 
>22:54:38.0 +0100
>@@ -61,6 +61,11 @@
>  */
> static spinlock_t panic_guard = SPIN_LOCK_UNLOCKED;
> 
>+#if REISER4_DEBUG
>+static int
>+reiser4_is_debugged(struct super_block *super, __u32 flag);
>+#endif
>+
> /* Your best friend. Call it on each occasion.  This is called by
> fs/reiser4/debug.h:reiser4_panic(). */
> reiser4_internal void
>@@ -303,19 +308,19 @@
>   return result;
> }
> 
>-/* REISER4_DEBUG */
>-#endif
>-
> /*
>  * check that some bits specified by @flags are set in ->debug_flags of the
>  * super block.
>  */
>-reiser4_internal int
>+static int
> reiser4_is_debugged(struct super_block *super, __u32 flag)
> {
>   return get_super_private(super)->debug_flags & flag;
> }
> 
>+/* REISER4_DEBUG */
>+#endif
>+
> /* allocate memory. This calls kmalloc(), performs some additional checks, and
>keeps

[2.6.11-rc5-mm1 patch] fs/reiser4/: possible cleanups

2005-03-11 Thread Adrian Bunk
This patch contains possible cleanups including the following:
- make needlessly global code static
- plugin/compress/minilzo.c: many cleanups
- remove or #if 0 the following unused global functions:
  - context.c: check_contexts
  - flush.c: jnode_tostring
  - flush.c: znode_tostring
  - flush.c: pos_tostring
  - flush_queue.c: fq_by_jnode
  - inode.c: get_reiser4_inode_by_key
  - lock.c: lock_mode
  - plugin/cryptcompress.c: set_nrpages_by_inode
  - file.c: readpages_unix_file
  - plugin/item/ctail.c: ctail_make_unprepped_cluster
  - plugin/item/extent_item_ops.c: show_extent
  - plugin/item/tail.c: show_tail
  - tree_walk.c: tree_walk

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

This patch was already sent on:
- 3 Mar 2005

 fs/reiser4/block_alloc.c |2 
 fs/reiser4/cluster.h |3 
 fs/reiser4/context.c |2 
 fs/reiser4/debug.c   |   13 +
 fs/reiser4/debug.h   |2 
 fs/reiser4/flush.c   |6 
 fs/reiser4/flush.h   |4 
 fs/reiser4/flush_queue.c |7 
 fs/reiser4/inode.c   |6 
 fs/reiser4/inode.h   |3 
 fs/reiser4/jnode.c   |8 -
 fs/reiser4/jnode.h   |2 
 fs/reiser4/lock.c|2 
 fs/reiser4/lock.h|1 
 fs/reiser4/page_cache.c  |2 
 fs/reiser4/plugin/compress/lzoconf.h |   23 --
 fs/reiser4/plugin/compress/minilzo.c |  179 +--
 fs/reiser4/plugin/cryptcompress.c|   15 -
 fs/reiser4/plugin/file/file.c|   14 -
 fs/reiser4/plugin/file/funcs.h   |2 
 fs/reiser4/plugin/item/ctail.c   |4 
 fs/reiser4/plugin/item/ctail.h   |1 
 fs/reiser4/plugin/item/extent.h  |1 
 fs/reiser4/plugin/item/extent_item_ops.c |2 
 fs/reiser4/plugin/item/tail.c|5 
 fs/reiser4/plugin/item/tail.h|1 
 fs/reiser4/plugin/object.c   |2 
 fs/reiser4/plugin/object.h   |1 
 fs/reiser4/tree_walk.c   |4 
 fs/reiser4/txnmgr.h  |1 
 fs/reiser4/vfs_ops.c |   14 -
 fs/reiser4/wander.c  |2 
 fs/reiser4/znode.c   |4 
 33 files changed, 66 insertions(+), 272 deletions(-)

--- linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c.old  2005-03-01 
21:18:07.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c  2005-03-01 
21:18:14.0 +0100
@@ -932,7 +932,7 @@
 #if REISER4_DEBUG
 
 /* check "allocated" state of given block range */
-void
+static void
 reiser4_check_blocks(const reiser4_block_nr * start, const reiser4_block_nr * 
len, int desired)
 {
sa_check_blocks(start, len, desired);
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c.old  2005-03-01 
21:18:31.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c  2005-03-01 
21:19:08.0 +0100
@@ -47,6 +47,7 @@
 /* lock protecting access to active_contexts. */
 spinlock_t active_contexts_lock;
 
+#if 0
 void
 check_contexts(void)
 {
@@ -58,6 +59,7 @@
}
spin_unlock(&active_contexts_lock);
 }
+#endif  /*  0  */
 
 #endif /* REISER4_DEBUG */
 
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h.old2005-03-01 
21:19:25.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h2005-03-01 
21:19:31.0 +0100
@@ -176,8 +176,6 @@
REISER4_CHECK_NODE = 0x0008
 } reiser4_debug_flags;
 
-extern int reiser4_is_debugged(struct super_block *super, __u32 flag);
-
 extern int is_in_reiser4_context(void);
 
 /*
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c.old2005-03-01 
21:19:38.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c2005-03-01 
22:54:38.0 +0100
@@ -61,6 +61,11 @@
  */
 static spinlock_t panic_guard = SPIN_LOCK_UNLOCKED;
 
+#if REISER4_DEBUG
+static int
+reiser4_is_debugged(struct super_block *super, __u32 flag);
+#endif
+
 /* Your best friend. Call it on each occasion.  This is called by
 fs/reiser4/debug.h:reiser4_panic(). */
 reiser4_internal void
@@ -303,19 +308,19 @@
return result;
 }
 
-/* REISER4_DEBUG */
-#endif
-
 /*
  * check that some bits specified by @flags are set in ->debug_flags of the
  * super block.
  */
-reiser4_internal int
+static int
 reiser4_is_debugged(struct super_block *super, __u32 flag)
 {
return get_super_private(super)->debug_flags & flag;
 }
 
+/* REISER4_DEBUG */
+#endif
+
 /* allocate memory. This calls kmalloc(), performs some additional checks, and
keeps track of how many memory was allocated on behalf of current super
block. */
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/flush.h.old2005-03-01 
21:21:31.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/flush.h2005-03-01 
21:21:40

[2.6.11-rc5-mm1 patch] fs/reiser4/: possible cleanups

2005-03-03 Thread Adrian Bunk
This patch contains possible cleanups including the following:
- make needlessly global code static
- plugin/compress/minilzo.c: many cleanups
- remove or #if 0 the following unused global functions:
  - context.c: check_contexts
  - flush.c: jnode_tostring
  - flush.c: znode_tostring
  - flush.c: pos_tostring
  - flush_queue.c: fq_by_jnode
  - inode.c: get_reiser4_inode_by_key
  - lock.c: lock_mode
  - plugin/cryptcompress.c: set_nrpages_by_inode
  - file.c: readpages_unix_file
  - plugin/item/ctail.c: ctail_make_unprepped_cluster
  - plugin/item/extent_item_ops.c: show_extent
  - plugin/item/tail.c: show_tail
  - tree_walk.c: tree_walk

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 fs/reiser4/block_alloc.c |2 
 fs/reiser4/cluster.h |3 
 fs/reiser4/context.c |2 
 fs/reiser4/debug.c   |   13 +
 fs/reiser4/debug.h   |2 
 fs/reiser4/flush.c   |6 
 fs/reiser4/flush.h   |4 
 fs/reiser4/flush_queue.c |7 
 fs/reiser4/inode.c   |6 
 fs/reiser4/inode.h   |3 
 fs/reiser4/jnode.c   |8 -
 fs/reiser4/jnode.h   |2 
 fs/reiser4/lock.c|2 
 fs/reiser4/lock.h|1 
 fs/reiser4/page_cache.c  |2 
 fs/reiser4/plugin/compress/lzoconf.h |   23 --
 fs/reiser4/plugin/compress/minilzo.c |  179 +--
 fs/reiser4/plugin/cryptcompress.c|   15 -
 fs/reiser4/plugin/file/file.c|   14 -
 fs/reiser4/plugin/file/funcs.h   |2 
 fs/reiser4/plugin/item/ctail.c   |4 
 fs/reiser4/plugin/item/ctail.h   |1 
 fs/reiser4/plugin/item/extent.h  |1 
 fs/reiser4/plugin/item/extent_item_ops.c |2 
 fs/reiser4/plugin/item/tail.c|5 
 fs/reiser4/plugin/item/tail.h|1 
 fs/reiser4/plugin/object.c   |2 
 fs/reiser4/plugin/object.h   |1 
 fs/reiser4/tree_walk.c   |4 
 fs/reiser4/txnmgr.h  |1 
 fs/reiser4/vfs_ops.c |   14 -
 fs/reiser4/wander.c  |2 
 fs/reiser4/znode.c   |4 
 33 files changed, 66 insertions(+), 272 deletions(-)

--- linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c.old  2005-03-01 
21:18:07.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/block_alloc.c  2005-03-01 
21:18:14.0 +0100
@@ -932,7 +932,7 @@
 #if REISER4_DEBUG
 
 /* check "allocated" state of given block range */
-void
+static void
 reiser4_check_blocks(const reiser4_block_nr * start, const reiser4_block_nr * 
len, int desired)
 {
sa_check_blocks(start, len, desired);
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c.old  2005-03-01 
21:18:31.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/context.c  2005-03-01 
21:19:08.0 +0100
@@ -47,6 +47,7 @@
 /* lock protecting access to active_contexts. */
 spinlock_t active_contexts_lock;
 
+#if 0
 void
 check_contexts(void)
 {
@@ -58,6 +59,7 @@
}
spin_unlock(&active_contexts_lock);
 }
+#endif  /*  0  */
 
 #endif /* REISER4_DEBUG */
 
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h.old2005-03-01 
21:19:25.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.h2005-03-01 
21:19:31.0 +0100
@@ -176,8 +176,6 @@
REISER4_CHECK_NODE = 0x0008
 } reiser4_debug_flags;
 
-extern int reiser4_is_debugged(struct super_block *super, __u32 flag);
-
 extern int is_in_reiser4_context(void);
 
 /*
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c.old2005-03-01 
21:19:38.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/debug.c2005-03-01 
22:54:38.0 +0100
@@ -61,6 +61,11 @@
  */
 static spinlock_t panic_guard = SPIN_LOCK_UNLOCKED;
 
+#if REISER4_DEBUG
+static int
+reiser4_is_debugged(struct super_block *super, __u32 flag);
+#endif
+
 /* Your best friend. Call it on each occasion.  This is called by
 fs/reiser4/debug.h:reiser4_panic(). */
 reiser4_internal void
@@ -303,19 +308,19 @@
return result;
 }
 
-/* REISER4_DEBUG */
-#endif
-
 /*
  * check that some bits specified by @flags are set in ->debug_flags of the
  * super block.
  */
-reiser4_internal int
+static int
 reiser4_is_debugged(struct super_block *super, __u32 flag)
 {
return get_super_private(super)->debug_flags & flag;
 }
 
+/* REISER4_DEBUG */
+#endif
+
 /* allocate memory. This calls kmalloc(), performs some additional checks, and
keeps track of how many memory was allocated on behalf of current super
block. */
--- linux-2.6.11-rc5-mm1-full/fs/reiser4/flush.h.old2005-03-01 
21:21:31.0 +0100
+++ linux-2.6.11-rc5-mm1-full/fs/reiser4/flush.h2005-03-01 
21:21:40.0 +0100
@@ -260,10 +260,6 @@
 void do