• Home
  • Raw
  • Download

Lines Matching refs:s

21 #define SB_ALLOC_OPTS(s) (REISERFS_SB(s)->s_alloc_options.bits)  argument
37 #define concentrating_formatted_nodes(s) test_bit(_ALLOC_concentrating_formatted_nodes, &SB_ALLOC_… argument
38 #define displacing_large_files(s) test_bit(_ALLOC_displacing_large_files, &SB_ALLOC_OPTS(s)) argument
39 …efine displacing_new_packing_localities(s) test_bit(_ALLOC_displacing_new_packing_localities, &SB… argument
43 reiserfs_warning(s, "reiserfs: option \"%s\" is set", #optname); \
44 set_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s)); \
46 #define TEST_OPTION(optname, s) \ argument
47 test_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s))
49 static inline void get_bit_address(struct super_block *s, in get_bit_address() argument
56 *bmap_nr = block >> (s->s_blocksize_bits + 3); in get_bit_address()
58 *offset = block & ((s->s_blocksize << 3) - 1); in get_bit_address()
61 int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) in is_reusable() argument
64 unsigned int bmap_count = reiserfs_bmap_count(s); in is_reusable()
66 if (block == 0 || block >= SB_BLOCK_COUNT(s)) { in is_reusable()
67 reiserfs_warning(s, in is_reusable()
69 block, SB_BLOCK_COUNT(s)); in is_reusable()
73 get_bit_address(s, block, &bmap, &offset); in is_reusable()
78 &(REISERFS_SB(s)->s_properties)))) { in is_reusable()
79 b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1; in is_reusable()
82 reiserfs_warning(s, "vs: 4019: is_reusable: " in is_reusable()
89 reiserfs_warning(s, "vs: 4020: is_reusable: " in is_reusable()
97 reiserfs_warning(s, in is_reusable()
103 if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { in is_reusable()
104 reiserfs_warning(s, in is_reusable()
106 "it must be busy", SB_ROOT_BLOCK(s)); in is_reusable()
115 static inline int is_block_in_journal(struct super_block *s, unsigned int bmap, in is_block_in_journal() argument
120 if (reiserfs_in_journal(s, bmap, off, 1, &tmp)) { in is_block_in_journal()
123 PROC_INFO_INC(s, scan_bitmap.in_journal_hint); in is_block_in_journal()
126 PROC_INFO_INC(s, scan_bitmap.in_journal_nohint); in is_block_in_journal()
128 PROC_INFO_INC(s, scan_bitmap.retry); in is_block_in_journal()
140 struct super_block *s = th->t_super; in scan_bitmap_block() local
141 struct reiserfs_bitmap_info *bi = &SB_AP_BITMAP(s)[bmap_n]; in scan_bitmap_block()
148 RFALSE(bmap_n >= reiserfs_bmap_count(s), "Bitmap %u is out of " in scan_bitmap_block()
149 "range (0..%u)", bmap_n, reiserfs_bmap_count(s) - 1); in scan_bitmap_block()
150 PROC_INFO_INC(s, scan_bitmap.bmap); in scan_bitmap_block()
157 reiserfs_warning(s, "NULL bitmap info pointer for bitmap %d", in scan_bitmap_block()
162 bh = reiserfs_read_bitmap_block(s, bmap_n); in scan_bitmap_block()
183 if (unfm && is_block_in_journal(s, bmap_n, *beg, beg)) in scan_bitmap_block()
194 if (unfm && is_block_in_journal(s, bmap_n, end, &next)) in scan_bitmap_block()
202 reiserfs_prepare_for_journal(s, bh, 1); in scan_bitmap_block()
210 PROC_INFO_INC(s, scan_bitmap.stolen); in scan_bitmap_block()
220 reiserfs_restore_prepared_buffer(s, bh); in scan_bitmap_block()
227 journal_mark_dirty(th, s, bh); in scan_bitmap_block()
231 reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), in scan_bitmap_block()
233 PUT_SB_FREE_BLOCKS(s, SB_FREE_BLOCKS(s) - (end - *beg)); in scan_bitmap_block()
234 journal_mark_dirty(th, s, SB_BUFFER_WITH_SB(s)); in scan_bitmap_block()
243 static int bmap_hash_id(struct super_block *s, u32 id) in bmap_hash_id() argument
254 bm = hash % reiserfs_bmap_count(s); in bmap_hash_id()
259 if (bm >= reiserfs_bmap_count(s)) in bmap_hash_id()
268 static inline int block_group_used(struct super_block *s, u32 id) in block_group_used() argument
270 int bm = bmap_hash_id(s, id); in block_group_used()
271 struct reiserfs_bitmap_info *info = &SB_AP_BITMAP(s)[bm]; in block_group_used()
279 struct buffer_head *bh = reiserfs_read_bitmap_block(s, bm); in block_group_used()
283 if (info->free_count > ((s->s_blocksize << 3) * 60 / 100)) { in block_group_used()
317 struct super_block *s = th->t_super; in scan_bitmap() local
323 unsigned int off_max = s->s_blocksize << 3; in scan_bitmap()
327 PROC_INFO_INC(s, scan_bitmap.call); in scan_bitmap()
328 if (SB_FREE_BLOCKS(s) <= 0) in scan_bitmap()
331 get_bit_address(s, *start, &bm, &off); in scan_bitmap()
332 get_bit_address(s, finish, &end_bm, &end_off); in scan_bitmap()
333 if (bm > reiserfs_bmap_count(s)) in scan_bitmap()
335 if (end_bm > reiserfs_bmap_count(s)) in scan_bitmap()
336 end_bm = reiserfs_bmap_count(s); in scan_bitmap()
350 if (TEST_OPTION(skip_busy, s) in scan_bitmap()
351 && SB_FREE_BLOCKS(s) > SB_BLOCK_COUNT(s) / 20) { in scan_bitmap()
354 || SB_AP_BITMAP(s)[bm].free_count > in scan_bitmap()
355 (s->s_blocksize << 3) / 10) in scan_bitmap()
363 get_bit_address(s, *start, &bm, &off); in scan_bitmap()
386 struct super_block *s = th->t_super; in _reiserfs_free_block() local
394 PROC_INFO_INC(s, free_block); in _reiserfs_free_block()
396 rs = SB_DISK_SUPER_BLOCK(s); in _reiserfs_free_block()
397 sbh = SB_BUFFER_WITH_SB(s); in _reiserfs_free_block()
398 apbi = SB_AP_BITMAP(s); in _reiserfs_free_block()
400 get_bit_address(s, block, &nr, &offset); in _reiserfs_free_block()
402 if (nr >= reiserfs_bmap_count(s)) { in _reiserfs_free_block()
403 reiserfs_warning(s, "vs-4075: reiserfs_free_block: " in _reiserfs_free_block()
406 reiserfs_bdevname(s), nr, in _reiserfs_free_block()
407 reiserfs_bmap_count(s)); in _reiserfs_free_block()
411 bmbh = reiserfs_read_bitmap_block(s, nr); in _reiserfs_free_block()
415 reiserfs_prepare_for_journal(s, bmbh, 1); in _reiserfs_free_block()
419 reiserfs_warning(s, "vs-4080: reiserfs_free_block: " in _reiserfs_free_block()
421 reiserfs_bdevname(s), block); in _reiserfs_free_block()
424 journal_mark_dirty(th, s, bmbh); in _reiserfs_free_block()
427 reiserfs_prepare_for_journal(s, sbh, 1); in _reiserfs_free_block()
431 journal_mark_dirty(th, s, sbh); in _reiserfs_free_block()
440 struct super_block *s = th->t_super; in reiserfs_free_block() local
443 RFALSE(!s, "vs-4061: trying to free block on nonexistent device"); in reiserfs_free_block()
444 if (!is_reusable(s, block, 1)) in reiserfs_free_block()
447 if (block > sb_block_count(REISERFS_SB(s)->s_rs)) { in reiserfs_free_block()
451 block, sb_block_count(REISERFS_SB(s)->s_rs)); in reiserfs_free_block()
455 journal_mark_freed(th, s, block); in reiserfs_free_block()
527 void reiserfs_init_alloc_options(struct super_block *s) in reiserfs_init_alloc_options() argument
529 set_bit(_ALLOC_skip_busy, &SB_ALLOC_OPTS(s)); in reiserfs_init_alloc_options()
530 set_bit(_ALLOC_dirid_groups, &SB_ALLOC_OPTS(s)); in reiserfs_init_alloc_options()
531 set_bit(_ALLOC_packing_groups, &SB_ALLOC_OPTS(s)); in reiserfs_init_alloc_options()
535 int reiserfs_parse_alloc_options(struct super_block *s, char *options) in reiserfs_parse_alloc_options() argument
539 REISERFS_SB(s)->s_alloc_options.bits = 0; /* clear default settings */ in reiserfs_parse_alloc_options()
552 REISERFS_SB(s)->s_alloc_options.border = 10; in reiserfs_parse_alloc_options()
554 REISERFS_SB(s)->s_alloc_options.border = in reiserfs_parse_alloc_options()
561 REISERFS_SB(s)->s_alloc_options.large_file_size = in reiserfs_parse_alloc_options()
619 REISERFS_SB(s)->s_alloc_options.preallocmin = in reiserfs_parse_alloc_options()
626 REISERFS_SB(s)->s_alloc_options.preallocsize = in reiserfs_parse_alloc_options()
634 reiserfs_warning(s, "zam-4001: %s : unknown option - %s", in reiserfs_parse_alloc_options()
639 reiserfs_warning(s, "allocator options = [%08x]\n", SB_ALLOC_OPTS(s)); in reiserfs_parse_alloc_options()
767 static inline void set_border_in_hint(struct super_block *s, in set_border_in_hint() argument
771 SB_BLOCK_COUNT(s) / REISERFS_SB(s)->s_alloc_options.border; in set_border_in_hint()
881 struct super_block *s = hint->th->t_super; in determine_search_start() local
885 hint->end = SB_BLOCK_COUNT(s) - 1; in determine_search_start()
888 if (concentrating_formatted_nodes(s)) in determine_search_start()
889 set_border_in_hint(s, hint); in determine_search_start()
895 if (displacing_new_packing_localities(s) in determine_search_start()
908 if (displacing_large_files(s) && !hint->formatted_node in determine_search_start()
916 if (hint->formatted_node && TEST_OPTION(hashed_formatted_nodes, s)) { in determine_search_start()
927 if (TEST_OPTION(old_way, s)) { in determine_search_start()
929 if (!reiserfs_hashed_relocation(s)) in determine_search_start()
931 else if (!reiserfs_no_unhashed_relocation(s)) in determine_search_start()
944 if (TEST_OPTION(hundredth_slices, s) in determine_search_start()
945 && !(displacing_large_files(s) && !hint->formatted_node)) { in determine_search_start()
952 TEST_OPTION(old_hashed_relocation, s)) { in determine_search_start()
957 TEST_OPTION(new_hashed_relocation, s)) { in determine_search_start()
961 if (!unfm_hint && !hint->formatted_node && TEST_OPTION(dirid_groups, s)) { in determine_search_start()
965 if (hint->formatted_node && TEST_OPTION(dirid_groups, s)) { in determine_search_start()
971 if (!unfm_hint && !hint->formatted_node && TEST_OPTION(oid_groups, s)) { in determine_search_start()
1043 struct super_block *s = hint->th->t_super; in blocknrs_and_prealloc_arrays_from_search_start() local
1045 b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1; in blocknrs_and_prealloc_arrays_from_search_start()
1053 reiserfs_debug(s, REISERFS_DEBUG_CODE, in blocknrs_and_prealloc_arrays_from_search_start()
1063 reiserfs_debug(s, REISERFS_DEBUG_CODE, in blocknrs_and_prealloc_arrays_from_search_start()
1080 finish = SB_BLOCK_COUNT(s) - 1; in blocknrs_and_prealloc_arrays_from_search_start()
1094 reiserfs_debug(s, REISERFS_DEBUG_CODE, in blocknrs_and_prealloc_arrays_from_search_start()
1125 reiserfs_debug(s, REISERFS_DEBUG_CODE, in blocknrs_and_prealloc_arrays_from_search_start()
1172 struct super_block *s = hint->th->t_super; in reiserfs_allocate_blocknrs() local
1175 if (SB_FREE_BLOCKS(s) - REISERFS_SB(s)->reserved_blocks < in reiserfs_allocate_blocknrs()
1195 if (hint->search_start >= SB_BLOCK_COUNT(s)) in reiserfs_allocate_blocknrs()
1196 hint->search_start = SB_BLOCK_COUNT(s) - 1; in reiserfs_allocate_blocknrs()