diff options
author | Jeff Mahoney <jeffm@suse.com> | 2014-04-23 10:00:46 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-05-07 18:31:06 +0200 |
commit | b49fb112d4ae62ca1c549130a111fb39e85e2c93 (patch) | |
tree | 7560fef7e8a15e04994d83867b8bc409cc256d06 /fs/reiserfs/reiserfs.h | |
parent | 97fd4b97a947dc9d11dee1bbcceca7a124df9e4e (diff) |
reiserfs: balance_leaf refactor, move state variables into tree_balance
This patch pushes the rest of the state variables in balance_leaf into
the tree_balance structure so we can use them when we split balance_leaf
into separate functions.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/reiserfs/reiserfs.h')
-rw-r--r-- | fs/reiserfs/reiserfs.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 40bb5cebab65..bf53888c7f59 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -2471,12 +2471,6 @@ struct tree_balance { /* number of items that fall into left most node when S[0] splits */ int s0num; - /* number of items that fall into first new node when S[0] splits */ - int s1num; - - /* number of items that fall into second new node when S[0] splits */ - int s2num; - /* * number of bytes which can flow to the left neighbor from the left * most liquid item that cannot be shifted from S[0] entirely @@ -2491,12 +2485,30 @@ struct tree_balance { */ int rbytes; + + /* + * index into the array of item headers in + * S[0] of the affected item + */ + int item_pos; + + /* new nodes allocated to hold what could not fit into S */ + struct buffer_head *S_new[2]; + + /* + * number of items that will be placed into nodes in S_new + * when S[0] splits + */ + int snum[2]; + /* - * number of bytes which flow to the first new node when S[0] splits + * number of bytes which flow to nodes in S_new when S[0] splits * note: if S[0] splits into 3 nodes, then items do not need to be cut */ - int s1bytes; - int s2bytes; + int sbytes[2]; + + int pos_in_item; + int zeroes_num; /* * buffers which are to be freed after do_balance finishes |