Skip to contentSkip to conversation

reiserfs: split right balancing part of balance_leaf() off

PATCH Jeff Mahoney 1 participant 3 messages Jun 8, 2007 8 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1181257975.21257.9.camel@localhost

#5 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 20 lines · Zan Lynx
Quoted 1 line · Jeff Mahoney

Vladimir V. Saveliev wrote:

[cut]

Quoted 7 lines
Quoted 3 lines

shouldn't function name prefixes be more consistent? Either bl_ or balance_leaf everywhere?

Yes, absolutely. Initially they were, but balance_leaf_function_subfunction(parameter list) ended up with the parameters grouped along the right margin. I wouldn't be opposed to changing them all to bl_* except for balance_leaf itself.

Or you could trade vertical space for horizontal space and do like:

static void balance_leaf_right_paste_de_partial(
struct tree_balance *tb, struct item_head *ih, const char *body, int flag, int *zeros_num, int item_pos, int *pos_in_item
) {

Quoted 3 lines

I always thought wasting all that horizontal space in parameter lists was silly just to save some vertical, and so many people get the tab-stop/space mix wrong.

Well, I actually meant with the call sites, where the start of the funciton call is already two or three tab stops in. The next revision uses bl_* for all of them.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGaLDXLPWxlyuTD7IRArMUAJ49r+82Hbj7TpHZOAIf3q1z3egV5ACeN+IH iJroW0vmxIY1I6fiNDy/Dyg=
=p/e1
-----END PGP SIGNATURE-----

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Re: [PATCH 00/39] reiserfs: patch queue

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 59 lines · Vladimir V. Saveliev

Hello

Quoted 56 lines · Jeff Mahoney

Hi all -

The following are a series of patches that have been kicking around for a while. I thought I'd just put them out there to gauge interest and to get some testing before submitting to -mm.

There are a few groups:
* Little changes (01,02,09)
- Fixes lockdep warnings in xattr code
- Changes reiserfs_panic() to panic() instead of BUG.
- Includes bitmap is_reusable unconditionally and uses to to catch corruption. This is light-weight now that the stupid loop is gone.
- Make bitmap used cached first zero bit.

* Error handling (03-08)
- Reformat error/warning/panic/info/etc messages to be consistent with one another.
- Makes some warnings informational. Rather than printing the reiserfs_warning() full preamble to declare that a mount option was invalid, we use reiserfs_info instead.
- Rework reiserfs_warning to take a unique ID, print the function name, print the device name.
- Rework reiserfs_panic similarly.
- Add reiserfs_error() to handle metadata errors.
- Use reiserfs_error().

* Extended attributes (11-21)
- Simplify internal file lookups/opens
- Eliminate per-super xattr lock
- Make per-inode xattr lock more fine-grained
- Remove i_has_xattr_dir flag
- Remove shared xattr detection (unused)
- Use generic xattr handler infrastructure
- Use O_NOATIME for internal file opens
- Add per-file data=ordered mode and use it for xattrs
- Journal xattrs
- Kill xattr_readdir in favor of a for_each_xattr
- Add atomic addition of selinux attributes during inode creation

* Cleanups, code readability (22-29)
- Cleanup path functions to reduce redundancy
- Strip trailing whitespace from all reiserfs code
- Rename p_s_sb to sb
- Rename p_s_bh to bh
- Rename p_s_inode to inode
- Rename p_s_tb to tb
- Rename misc p_._ variables
- Rename [cn]_* variables

* Clean up do_balan.c (30-39)
- Factor out buffer_info initializations
- Turn tb->s[12]num and tb[12]bytes into an array
- Split balance_leaf from the 2500 line beast to more manageable chunks
- Clean up balance_leaf_when_delete
- Clean up comments

Quoted 4 lines
Quoted 1 line

I look forward to comments.

good work

Thanks for the code review. I appreciate it. Another set of eyes always helps. :)

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGaX2WLPWxlyuTD7IRAkPHAJ9t07qx4yyYh/BvbqJAKQCJp63OigCfUYV0 4xoX5yWGCoh6cDQlyUV3tM4=
=1Ql8
-----END PGP SIGNATURE-----

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Re: [PATCH 07/39] reiserfs: introduce reiserfs_error()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 22 lines · Vladimir V. Saveliev
Quoted 21 lines · Jeff Mahoney

Although reiserfs can currently handle severe errors such as journal failure, it cannot handle less severe errors like metadata i/o failure. The following patch adds a reiserfs_error() function akin to the one in ext3.

Subsequent patches will use this new error handler to handle errors more gracefully in general.

--

 fs/reiserfs/prints.c        |   33 +++++++++++++++++++++++++++++++++
 include/linux/reiserfs_fs.h |    3 +++
 2 files changed, 36 insertions(+)
fs/reiserfs/prints.c +0 -0
@@ -373,6 +373,39 @@ void __reiserfs_panic(struct super_block
 		      id ? id : "", id ? " " : "", function, error_buf);
 }
 
Quoted 14 lines

fs/reiserfs/prints.c void __reiserfs_panic(struct super_block · line 387

Quoted 12 lines
fs/reiserfs/prints.c +12 -0
+void reiserfs_handle_error(struct super_block *sb, int errno)
+{
+
+	if (sb->s_flags & MS_RDONLY)
+		return;
+
+	if (reiserfs_error_ro(sb)) {
+		reiserfs_info(sb, "Remounting filesystem read-only\n");
+		sb->s_flags |= MS_RDONLY;
+	} else {
+		reiserfs_journal_abort(sb, errno);
+	}

shouldn't reiserfs_journal_abort be called in either case?

Yeah, you're probably right. I mostly lifted the logic for this from ext3, which is less fragile in that sense.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGaacJLPWxlyuTD7IRAvxeAJ9gj/bPaTeCI6TLo8lvT8fA8ziGnQCgori6 xmnW1N/FAUefyCVl42HEYIo=
=9vBW
-----END PGP SIGNATURE-----