All of lore.kernel.org
 help / color / mirror / Atom feed
From: jeffm@suse.com
To: ReiserFS Mailing List <reiserfs-devel@vger.kernel.org>
Subject: [patch 38/40] reiserfs: clean up balancing modes
Date: Mon, 11 Jun 2007 15:03:47 -0400	[thread overview]
Message-ID: <20070611190633.631633722@suse.com> (raw)
In-Reply-To: 20070611190309.532091171@suse.com

[-- Attachment #1: reiserfs-cleanup-balancing-modes.diff --]
[-- Type: text/plain, Size: 2824 bytes --]

 This patch turns the character balancing modes into an enum, since the
 letter itself is irrelevant.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>

---
 fs/reiserfs/prints.c        |   17 +++++++++++++++++
 include/linux/reiserfs_fs.h |   34 ++++++++++++++++------------------
 2 files changed, 33 insertions(+), 18 deletions(-)

--- a/fs/reiserfs/prints.c	2007-06-11 14:49:41.000000000 -0400
+++ b/fs/reiserfs/prints.c	2007-06-11 14:49:43.000000000 -0400
@@ -14,6 +14,23 @@ static char error_buf[1024];
 static char fmt_buf[1024];
 static char off_buf[80];
 
+const char *tb_mode_names(enum tb_modes mode)
+{
+	char * const names[] = {
+	"INSERT",
+	"PASTE",
+	"DELETE",
+	"CUT",
+	"INTERNAL",
+	"SKIP_BALANCING",
+	"CONVERT",
+	};
+
+	if (mode >= M_MAX_MODES)
+		return "UNKNOWN";
+	return names[mode];
+}
+
 static char *reiserfs_cpu_offset(struct cpu_key *key)
 {
 	if (cpu_key_k_type(key) == TYPE_DIRENTRY)
--- a/include/linux/reiserfs_fs.h	2007-06-11 14:49:41.000000000 -0400
+++ b/include/linux/reiserfs_fs.h	2007-06-11 14:49:43.000000000 -0400
@@ -1388,27 +1388,24 @@ struct tree_balance {
 	struct in_core_key key;	/* key pointer, to pass to block allocator or
 				   another low-level subsystem */
 #endif
+	struct bl_context *context;
 };
 
 /* These are modes of balancing */
-
-/* When inserting an item. */
-#define M_INSERT	'i'
-/* When inserting into (directories only) or appending onto an already
-   existant item. */
-#define M_PASTE		'p'
-/* When deleting an item. */
-#define M_DELETE	'd'
-/* When truncating an item or removing an entry from a (directory) item. */
-#define M_CUT 		'c'
-
-/* used when balancing on leaf level skipped (in reiserfsck) */
-#define M_INTERNAL	'n'
-
-/* When further balancing is not needed, then do_balance does not need
-   to be called. */
-#define M_SKIP_BALANCING 		's'
-#define M_CONVERT	'v'
+enum tb_modes {
+	M_INSERT = 0,	/* When inserting an item. */
+	M_PASTE,	/* When inserting into (directories only) or
+			 * appending onto an already existant item. */
+	M_DELETE,	/* When deleting an item. */
+	M_CUT,		/* When truncating an item or removing an entry
+	                 * from a (directory) item. */
+	M_INTERNAL,	/* used when balancing on leaf level
+			 * skipped (in reiserfsck) */
+	M_SKIP_BALANCING, /* When further balancing is not needed,
+			   * then do_balance does not need to be called. */
+	M_CONVERT,
+	M_MAX_MODES
+};
 
 /* modes of leaf_move_items */
 #define LEAF_FROM_S_TO_L 0
@@ -2027,6 +2024,7 @@ void check_leaf(struct buffer_head *bh);
 void check_internal(struct buffer_head *bh);
 void print_statistics(struct super_block *s);
 char *reiserfs_hashname(int code);
+const char *tb_mode_names(enum tb_modes);
 
 /* lbalance.c */
 int leaf_move_items(int shift_mode, struct tree_balance *tb, int mov_num,

-- 
Jeff Mahoney
SUSE Labs


  parent reply	other threads:[~2007-06-11 19:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 19:03 [patch 00/40] reiserfs: patch queue (v2) jeffm
2007-06-11 19:03 ` [patch 01/40] reiserfs: fix up lockdep warnings jeffm
2007-06-11 19:03 ` [patch 02/40] reiserfs: dont use BUG when panicking jeffm
2007-06-11 19:03 ` [patch 03/40] reiserfs: use is_reusable to catch corruption jeffm
2007-06-13 15:54   ` Jeff Mahoney
2007-06-11 19:03 ` [patch 04/40] reiserfs: make bitmap use cached first zero bit jeffm
2007-06-11 19:03 ` [patch 05/40] reiserfs: use more consistent printk formatting jeffm
2007-06-11 19:03 ` [patch 06/40] reiserfs: make some warnings informational jeffm
2007-06-11 19:03 ` [patch 07/40] reiserfs: rework reiserfs_warning jeffm
2007-06-11 19:03 ` [patch 08/40] reiserfs: rework reiserfs_panic jeffm
2007-06-11 19:03 ` [patch 09/40] reiserfs: rearrange journal abort jeffm
2007-06-11 19:03 ` [patch 10/40] reiserfs: introduce reiserfs_error() jeffm
2007-06-11 19:03 ` [patch 11/40] reiserfs: use reiserfs_error() jeffm
2007-06-11 19:03 ` [patch 12/40] reiserfs: simplify xattr internal file lookups/opens jeffm
2007-06-11 19:03 ` [patch 13/40] reiserfs: eliminate per-super xattr lock jeffm
2007-06-11 19:03 ` [patch 14/40] reiserfs: make per-inode xattr locking more fine grained jeffm
2007-06-11 19:03 ` [patch 15/40] reiserfs: remove i_has_xattr_dir jeffm
2007-06-11 19:03 ` [patch 16/40] reiserfs: remove link detection code jeffm
2007-06-11 19:03 ` [patch 17/40] reiserfs: use generic xattr handlers jeffm
2007-06-11 19:03 ` [patch 18/40] reiserfs: use better open options for internal files jeffm
2007-06-11 19:03 ` [patch 19/40] reiserfs: add per-file data=ordered mode and use it for xattrs jeffm
2007-06-11 19:03 ` [patch 20/40] reiserfs: journaled xattrs jeffm
2007-06-11 19:03 ` [patch 21/40] reiserfs: use generic readdir for operations across all xattrs jeffm
2007-06-11 19:03 ` [patch 22/40] reiserfs: add atomic addition of selinux attributes during inode creation jeffm
2007-06-11 19:03 ` [patch 23/40] reiserfs: cleanup path functions jeffm
2007-06-11 19:03 ` [patch 24/40] reiserfs: strip trailing whitespace jeffm
2007-06-11 19:03 ` [patch 26/40] reiserfs: rename p_s_bh to bh jeffm
2007-06-11 19:03 ` [patch 27/40] reiserfs: rename p_s_inode to inode jeffm
2007-06-11 19:03 ` [patch 28/40] reiserfs: rename p_s_tb to tb jeffm
2007-06-11 19:03 ` [patch 29/40] reiserfs: rename p_._ variables jeffm
2007-06-11 19:03 ` [patch 30/40] reiserfs: rename _* variables jeffm
2007-06-11 19:03 ` [patch 31/40] reiserfs: factor out buffer_info initialization jeffm
2007-06-11 19:03 ` [patch 32/40] reiserfs: Turn tb->snum and tb->sbytes into an array jeffm
2007-06-11 19:03 ` [patch 33/40] reiserfs: split left balancing part of balance_leaf() off jeffm
2007-06-11 19:03 ` [patch 34/40] reiserfs: split right " jeffm
2007-06-11 19:03 ` [patch 35/40] reiserfs: split balance_leaf new node handling out jeffm
2007-06-11 19:03 ` [patch 36/40] reiserfs: split out current node handling from balance_leaf jeffm
2007-06-11 19:03 ` [patch 37/40] reiserfs: clean up bl_when_delete jeffm
2007-06-11 19:03 ` jeffm [this message]
2007-06-11 19:03 ` [patch 39/40] reiserfs: split bl_when_delete jeffm
2007-06-11 19:03 ` [patch 40/40] reiserfs: reorganize do_balan.c comments jeffm
2007-06-11 19:20 ` [patch 00/40] reiserfs: patch queue (v2) Jeff Mahoney
2007-06-14 19:41 ` Jeff Mahoney

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=20070611190633.631633722@suse.com \
    --to=jeffm@suse.com \
    --cc=reiserfs-devel@vger.kernel.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 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.