diff options
Diffstat (limited to 'fs/reiserfs/bitmap.c')
-rw-r--r-- | fs/reiserfs/bitmap.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index cca1dbf5458f..1bfae42117ca 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c | |||
@@ -1034,7 +1034,6 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1034 | b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1; | 1034 | b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1; |
1035 | int passno = 0; | 1035 | int passno = 0; |
1036 | int nr_allocated = 0; | 1036 | int nr_allocated = 0; |
1037 | int bigalloc = 0; | ||
1038 | 1037 | ||
1039 | determine_prealloc_size(hint); | 1038 | determine_prealloc_size(hint); |
1040 | if (!hint->formatted_node) { | 1039 | if (!hint->formatted_node) { |
@@ -1061,28 +1060,9 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1061 | hint->preallocate = hint->prealloc_size = 0; | 1060 | hint->preallocate = hint->prealloc_size = 0; |
1062 | } | 1061 | } |
1063 | /* for unformatted nodes, force large allocations */ | 1062 | /* for unformatted nodes, force large allocations */ |
1064 | bigalloc = amount_needed; | ||
1065 | } | 1063 | } |
1066 | 1064 | ||
1067 | do { | 1065 | do { |
1068 | /* in bigalloc mode, nr_allocated should stay zero until | ||
1069 | * the entire allocation is filled | ||
1070 | */ | ||
1071 | if (unlikely(bigalloc && nr_allocated)) { | ||
1072 | reiserfs_warning(s, "bigalloc is %d, nr_allocated %d\n", | ||
1073 | bigalloc, nr_allocated); | ||
1074 | /* reset things to a sane value */ | ||
1075 | bigalloc = amount_needed - nr_allocated; | ||
1076 | } | ||
1077 | /* | ||
1078 | * try pass 0 and pass 1 looking for a nice big | ||
1079 | * contiguous allocation. Then reset and look | ||
1080 | * for anything you can find. | ||
1081 | */ | ||
1082 | if (passno == 2 && bigalloc) { | ||
1083 | passno = 0; | ||
1084 | bigalloc = 0; | ||
1085 | } | ||
1086 | switch (passno++) { | 1066 | switch (passno++) { |
1087 | case 0: /* Search from hint->search_start to end of disk */ | 1067 | case 0: /* Search from hint->search_start to end of disk */ |
1088 | start = hint->search_start; | 1068 | start = hint->search_start; |
@@ -1120,8 +1100,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1120 | new_blocknrs + | 1100 | new_blocknrs + |
1121 | nr_allocated, | 1101 | nr_allocated, |
1122 | start, finish, | 1102 | start, finish, |
1123 | bigalloc ? | 1103 | 1, |
1124 | bigalloc : 1, | ||
1125 | amount_needed - | 1104 | amount_needed - |
1126 | nr_allocated, | 1105 | nr_allocated, |
1127 | hint-> | 1106 | hint-> |