diff options
Diffstat (limited to 'fs/reiserfs/fix_node.c')
-rw-r--r-- | fs/reiserfs/fix_node.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index aee50c97988d..a3be7da3e2b9 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c | |||
@@ -30,8 +30,8 @@ | |||
30 | ** get_direct_parent | 30 | ** get_direct_parent |
31 | ** get_neighbors | 31 | ** get_neighbors |
32 | ** fix_nodes | 32 | ** fix_nodes |
33 | ** | 33 | ** |
34 | ** | 34 | ** |
35 | **/ | 35 | **/ |
36 | 36 | ||
37 | #include <linux/time.h> | 37 | #include <linux/time.h> |
@@ -377,9 +377,9 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, | |||
377 | int needed_nodes; | 377 | int needed_nodes; |
378 | int start_item, /* position of item we start filling node from */ | 378 | int start_item, /* position of item we start filling node from */ |
379 | end_item, /* position of item we finish filling node by */ | 379 | end_item, /* position of item we finish filling node by */ |
380 | start_bytes, /* number of first bytes (entries for directory) of start_item-th item | 380 | start_bytes, /* number of first bytes (entries for directory) of start_item-th item |
381 | we do not include into node that is being filled */ | 381 | we do not include into node that is being filled */ |
382 | end_bytes; /* number of last bytes (entries for directory) of end_item-th item | 382 | end_bytes; /* number of last bytes (entries for directory) of end_item-th item |
383 | we do node include into node that is being filled */ | 383 | we do node include into node that is being filled */ |
384 | int split_item_positions[2]; /* these are positions in virtual item of | 384 | int split_item_positions[2]; /* these are positions in virtual item of |
385 | items, that are split between S[0] and | 385 | items, that are split between S[0] and |
@@ -569,7 +569,7 @@ extern struct tree_balance *cur_tb; | |||
569 | 569 | ||
570 | /* Set parameters for balancing. | 570 | /* Set parameters for balancing. |
571 | * Performs write of results of analysis of balancing into structure tb, | 571 | * Performs write of results of analysis of balancing into structure tb, |
572 | * where it will later be used by the functions that actually do the balancing. | 572 | * where it will later be used by the functions that actually do the balancing. |
573 | * Parameters: | 573 | * Parameters: |
574 | * tb tree_balance structure; | 574 | * tb tree_balance structure; |
575 | * h current level of the node; | 575 | * h current level of the node; |
@@ -1204,7 +1204,7 @@ static inline int can_node_be_removed(int mode, int lfree, int sfree, int rfree, | |||
1204 | * h current level of the node; | 1204 | * h current level of the node; |
1205 | * inum item number in S[h]; | 1205 | * inum item number in S[h]; |
1206 | * mode i - insert, p - paste; | 1206 | * mode i - insert, p - paste; |
1207 | * Returns: 1 - schedule occurred; | 1207 | * Returns: 1 - schedule occurred; |
1208 | * 0 - balancing for higher levels needed; | 1208 | * 0 - balancing for higher levels needed; |
1209 | * -1 - no balancing for higher levels needed; | 1209 | * -1 - no balancing for higher levels needed; |
1210 | * -2 - no disk space. | 1210 | * -2 - no disk space. |
@@ -1239,7 +1239,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) | |||
1239 | /* we perform 8 calls to get_num_ver(). For each call we calculate five parameters. | 1239 | /* we perform 8 calls to get_num_ver(). For each call we calculate five parameters. |
1240 | where 4th parameter is s1bytes and 5th - s2bytes | 1240 | where 4th parameter is s1bytes and 5th - s2bytes |
1241 | */ | 1241 | */ |
1242 | short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases | 1242 | short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases |
1243 | 0,1 - do not shift and do not shift but bottle | 1243 | 0,1 - do not shift and do not shift but bottle |
1244 | 2 - shift only whole item to left | 1244 | 2 - shift only whole item to left |
1245 | 3 - shift to left and bottle as much as possible | 1245 | 3 - shift to left and bottle as much as possible |
@@ -1288,7 +1288,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) | |||
1288 | 1288 | ||
1289 | create_virtual_node(tb, h); | 1289 | create_virtual_node(tb, h); |
1290 | 1290 | ||
1291 | /* | 1291 | /* |
1292 | determine maximal number of items we can shift to the left neighbor (in tb structure) | 1292 | determine maximal number of items we can shift to the left neighbor (in tb structure) |
1293 | and the maximal number of bytes that can flow to the left neighbor | 1293 | and the maximal number of bytes that can flow to the left neighbor |
1294 | from the left most liquid item that cannot be shifted from S[0] entirely (returned value) | 1294 | from the left most liquid item that cannot be shifted from S[0] entirely (returned value) |
@@ -1349,13 +1349,13 @@ static int ip_check_balance(struct tree_balance *tb, int h) | |||
1349 | 1349 | ||
1350 | { | 1350 | { |
1351 | int lpar, rpar, nset, lset, rset, lrset; | 1351 | int lpar, rpar, nset, lset, rset, lrset; |
1352 | /* | 1352 | /* |
1353 | * regular overflowing of the node | 1353 | * regular overflowing of the node |
1354 | */ | 1354 | */ |
1355 | 1355 | ||
1356 | /* get_num_ver works in 2 modes (FLOW & NO_FLOW) | 1356 | /* get_num_ver works in 2 modes (FLOW & NO_FLOW) |
1357 | lpar, rpar - number of items we can shift to left/right neighbor (including splitting item) | 1357 | lpar, rpar - number of items we can shift to left/right neighbor (including splitting item) |
1358 | nset, lset, rset, lrset - shows, whether flowing items give better packing | 1358 | nset, lset, rset, lrset - shows, whether flowing items give better packing |
1359 | */ | 1359 | */ |
1360 | #define FLOW 1 | 1360 | #define FLOW 1 |
1361 | #define NO_FLOW 0 /* do not any splitting */ | 1361 | #define NO_FLOW 0 /* do not any splitting */ |
@@ -1545,7 +1545,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) | |||
1545 | * h current level of the node; | 1545 | * h current level of the node; |
1546 | * inum item number in S[h]; | 1546 | * inum item number in S[h]; |
1547 | * mode i - insert, p - paste; | 1547 | * mode i - insert, p - paste; |
1548 | * Returns: 1 - schedule occurred; | 1548 | * Returns: 1 - schedule occurred; |
1549 | * 0 - balancing for higher levels needed; | 1549 | * 0 - balancing for higher levels needed; |
1550 | * -1 - no balancing for higher levels needed; | 1550 | * -1 - no balancing for higher levels needed; |
1551 | * -2 - no disk space. | 1551 | * -2 - no disk space. |
@@ -1728,7 +1728,7 @@ static int dc_check_balance_internal(struct tree_balance *tb, int h) | |||
1728 | * h current level of the node; | 1728 | * h current level of the node; |
1729 | * inum item number in S[h]; | 1729 | * inum item number in S[h]; |
1730 | * mode i - insert, p - paste; | 1730 | * mode i - insert, p - paste; |
1731 | * Returns: 1 - schedule occurred; | 1731 | * Returns: 1 - schedule occurred; |
1732 | * 0 - balancing for higher levels needed; | 1732 | * 0 - balancing for higher levels needed; |
1733 | * -1 - no balancing for higher levels needed; | 1733 | * -1 - no balancing for higher levels needed; |
1734 | * -2 - no disk space. | 1734 | * -2 - no disk space. |
@@ -1822,7 +1822,7 @@ static int dc_check_balance_leaf(struct tree_balance *tb, int h) | |||
1822 | * h current level of the node; | 1822 | * h current level of the node; |
1823 | * inum item number in S[h]; | 1823 | * inum item number in S[h]; |
1824 | * mode d - delete, c - cut. | 1824 | * mode d - delete, c - cut. |
1825 | * Returns: 1 - schedule occurred; | 1825 | * Returns: 1 - schedule occurred; |
1826 | * 0 - balancing for higher levels needed; | 1826 | * 0 - balancing for higher levels needed; |
1827 | * -1 - no balancing for higher levels needed; | 1827 | * -1 - no balancing for higher levels needed; |
1828 | * -2 - no disk space. | 1828 | * -2 - no disk space. |
@@ -1851,7 +1851,7 @@ static int dc_check_balance(struct tree_balance *tb, int h) | |||
1851 | * h current level of the node; | 1851 | * h current level of the node; |
1852 | * inum item number in S[h]; | 1852 | * inum item number in S[h]; |
1853 | * mode i - insert, p - paste, d - delete, c - cut. | 1853 | * mode i - insert, p - paste, d - delete, c - cut. |
1854 | * Returns: 1 - schedule occurred; | 1854 | * Returns: 1 - schedule occurred; |
1855 | * 0 - balancing for higher levels needed; | 1855 | * 0 - balancing for higher levels needed; |
1856 | * -1 - no balancing for higher levels needed; | 1856 | * -1 - no balancing for higher levels needed; |
1857 | * -2 - no disk space. | 1857 | * -2 - no disk space. |
@@ -2296,15 +2296,15 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) | |||
2296 | * analyze what and where should be moved; | 2296 | * analyze what and where should be moved; |
2297 | * get sufficient number of new nodes; | 2297 | * get sufficient number of new nodes; |
2298 | * Balancing will start only after all resources will be collected at a time. | 2298 | * Balancing will start only after all resources will be collected at a time. |
2299 | * | 2299 | * |
2300 | * When ported to SMP kernels, only at the last moment after all needed nodes | 2300 | * When ported to SMP kernels, only at the last moment after all needed nodes |
2301 | * are collected in cache, will the resources be locked using the usual | 2301 | * are collected in cache, will the resources be locked using the usual |
2302 | * textbook ordered lock acquisition algorithms. Note that ensuring that | 2302 | * textbook ordered lock acquisition algorithms. Note that ensuring that |
2303 | * this code neither write locks what it does not need to write lock nor locks out of order | 2303 | * this code neither write locks what it does not need to write lock nor locks out of order |
2304 | * will be a pain in the butt that could have been avoided. Grumble grumble. -Hans | 2304 | * will be a pain in the butt that could have been avoided. Grumble grumble. -Hans |
2305 | * | 2305 | * |
2306 | * fix is meant in the sense of render unchanging | 2306 | * fix is meant in the sense of render unchanging |
2307 | * | 2307 | * |
2308 | * Latency might be improved by first gathering a list of what buffers are needed | 2308 | * Latency might be improved by first gathering a list of what buffers are needed |
2309 | * and then getting as many of them in parallel as possible? -Hans | 2309 | * and then getting as many of them in parallel as possible? -Hans |
2310 | * | 2310 | * |
@@ -2316,7 +2316,7 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) | |||
2316 | * ins_ih & ins_sd are used when inserting | 2316 | * ins_ih & ins_sd are used when inserting |
2317 | * Returns: 1 - schedule occurred while the function worked; | 2317 | * Returns: 1 - schedule occurred while the function worked; |
2318 | * 0 - schedule didn't occur while the function worked; | 2318 | * 0 - schedule didn't occur while the function worked; |
2319 | * -1 - if no_disk_space | 2319 | * -1 - if no_disk_space |
2320 | */ | 2320 | */ |
2321 | 2321 | ||
2322 | int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ins_ih, // item head of item being inserted | 2322 | int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ins_ih, // item head of item being inserted |