Lines Matching refs:sb
92 struct super_block *sb);
110 struct super_block *sb,
113 static void init_journal_hash(struct super_block *sb) in init_journal_hash() argument
115 struct reiserfs_journal *journal = SB_JOURNAL(sb); in init_journal_hash()
136 *sb) in allocate_bitmap_node()
145 bn->data = kzalloc(sb->s_blocksize, GFP_NOFS); in allocate_bitmap_node()
155 static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *sb) in get_bitmap_node() argument
157 struct reiserfs_journal *journal = SB_JOURNAL(sb); in get_bitmap_node()
167 memset(bn->data, 0, sb->s_blocksize); in get_bitmap_node()
171 bn = allocate_bitmap_node(sb); in get_bitmap_node()
178 static inline void free_bitmap_node(struct super_block *sb, in free_bitmap_node() argument
181 struct reiserfs_journal *journal = SB_JOURNAL(sb); in free_bitmap_node()
192 static void allocate_bitmap_nodes(struct super_block *sb) in allocate_bitmap_nodes() argument
195 struct reiserfs_journal *journal = SB_JOURNAL(sb); in allocate_bitmap_nodes()
198 bn = allocate_bitmap_node(sb); in allocate_bitmap_nodes()
209 static int set_bit_in_list_bitmap(struct super_block *sb, in set_bit_in_list_bitmap() argument
213 unsigned int bmap_nr = block / (sb->s_blocksize << 3); in set_bit_in_list_bitmap()
214 unsigned int bit_nr = block % (sb->s_blocksize << 3); in set_bit_in_list_bitmap()
217 jb->bitmaps[bmap_nr] = get_bitmap_node(sb); in set_bit_in_list_bitmap()
223 static void cleanup_bitmap_list(struct super_block *sb, in cleanup_bitmap_list() argument
230 for (i = 0; i < reiserfs_bmap_count(sb); i++) { in cleanup_bitmap_list()
232 free_bitmap_node(sb, jb->bitmaps[i]); in cleanup_bitmap_list()
241 static int free_list_bitmaps(struct super_block *sb, in free_list_bitmaps() argument
249 cleanup_bitmap_list(sb, jb); in free_list_bitmaps()
256 static int free_bitmap_nodes(struct super_block *sb) in free_bitmap_nodes() argument
258 struct reiserfs_journal *journal = SB_JOURNAL(sb); in free_bitmap_nodes()
278 int reiserfs_allocate_list_bitmaps(struct super_block *sb, in reiserfs_allocate_list_bitmaps() argument
292 reiserfs_warning(sb, "clm-2000", "unable to " in reiserfs_allocate_list_bitmaps()
299 free_list_bitmaps(sb, jb_array); in reiserfs_allocate_list_bitmaps()
309 static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *sb, in get_list_bitmap() argument
314 struct reiserfs_journal *journal = SB_JOURNAL(sb); in get_list_bitmap()
322 flush_commit_list(sb, in get_list_bitmap()
367 static struct reiserfs_journal_cnode *get_cnode(struct super_block *sb) in get_cnode() argument
370 struct reiserfs_journal *journal = SB_JOURNAL(sb); in get_cnode()
372 reiserfs_check_lock_depth(sb, "get_cnode"); in get_cnode()
394 static void free_cnode(struct super_block *sb, in free_cnode() argument
397 struct reiserfs_journal *journal = SB_JOURNAL(sb); in free_cnode()
399 reiserfs_check_lock_depth(sb, "free_cnode"); in free_cnode()
424 *sb, in get_journal_hash_dev()
431 cn = journal_hash(table, sb, bl); in get_journal_hash_dev()
433 if (cn->blocknr == bl && cn->sb == sb) in get_journal_hash_dev()
459 int reiserfs_in_journal(struct super_block *sb, in reiserfs_in_journal() argument
463 struct reiserfs_journal *journal = SB_JOURNAL(sb); in reiserfs_in_journal()
470 PROC_INFO_INC(sb, journal.in_journal); in reiserfs_in_journal()
479 PROC_INFO_INC(sb, journal.in_journal_bitmap); in reiserfs_in_journal()
489 sb->s_blocksize << 3, in reiserfs_in_journal()
496 bl = bmap_nr * (sb->s_blocksize << 3) + bit_nr; in reiserfs_in_journal()
499 && (get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) { in reiserfs_in_journal()
504 if ((get_journal_hash_dev(sb, journal->j_hash_table, bl))) { in reiserfs_in_journal()
509 PROC_INFO_INC(sb, journal.in_journal_reusable); in reiserfs_in_journal()
520 cn_orig = journal_hash(table, cn->sb, cn->blocknr); in insert_journal_hash()
526 journal_hash(table, cn->sb, cn->blocknr) = cn; in insert_journal_hash()
530 static inline void lock_journal(struct super_block *sb) in lock_journal() argument
532 PROC_INFO_INC(sb, journal.lock_journal); in lock_journal()
534 reiserfs_mutex_lock_safe(&SB_JOURNAL(sb)->j_mutex, sb); in lock_journal()
538 static inline void unlock_journal(struct super_block *sb) in unlock_journal() argument
540 mutex_unlock(&SB_JOURNAL(sb)->j_mutex); in unlock_journal()
564 static void cleanup_freed_for_journal_list(struct super_block *sb, in cleanup_freed_for_journal_list() argument
570 cleanup_bitmap_list(sb, jb); in cleanup_freed_for_journal_list()
1169 struct super_block *sb = cn->sb; in find_newer_jl_for_cn() local
1174 if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist) { in find_newer_jl_for_cn()
1193 static void remove_all_from_journal_list(struct super_block *sb, in remove_all_from_journal_list() argument
1197 struct reiserfs_journal *journal = SB_JOURNAL(sb); in remove_all_from_journal_list()
1208 reiserfs_warning(sb, "reiserfs-2201", in remove_all_from_journal_list()
1214 remove_journal_hash(sb, journal->j_list_hash_table, in remove_all_from_journal_list()
1219 free_cnode(sb, last); in remove_all_from_journal_list()
1232 static int _update_journal_header_block(struct super_block *sb, in _update_journal_header_block() argument
1237 struct reiserfs_journal *journal = SB_JOURNAL(sb); in _update_journal_header_block()
1245 depth = reiserfs_write_unlock_nested(sb); in _update_journal_header_block()
1247 reiserfs_write_lock_nested(sb, depth); in _update_journal_header_block()
1250 reiserfs_warning(sb, "journal-699", in _update_journal_header_block()
1265 depth = reiserfs_write_unlock_nested(sb); in _update_journal_header_block()
1267 if (reiserfs_barrier_flush(sb)) in _update_journal_header_block()
1273 reiserfs_write_lock_nested(sb, depth); in _update_journal_header_block()
1275 reiserfs_warning(sb, "journal-837", in _update_journal_header_block()
1283 static int update_journal_header_block(struct super_block *sb, in update_journal_header_block() argument
1287 return _update_journal_header_block(sb, offset, trans_id); in update_journal_header_block()
1294 static int flush_older_journal_lists(struct super_block *sb, in flush_older_journal_lists() argument
1299 struct reiserfs_journal *journal = SB_JOURNAL(sb); in flush_older_journal_lists()
1315 flush_journal_list(sb, other_jl, 0); in flush_older_journal_lists()
1836 static void remove_journal_hash(struct super_block *sb, in remove_journal_hash() argument
1844 head = &(journal_hash(table, sb, block)); in remove_journal_hash()
1850 if (cur->blocknr == block && cur->sb == sb in remove_journal_hash()
1862 cur->sb = NULL; in remove_journal_hash()
1877 static void free_journal_ram(struct super_block *sb) in free_journal_ram() argument
1879 struct reiserfs_journal *journal = SB_JOURNAL(sb); in free_journal_ram()
1884 free_list_bitmaps(sb, journal->j_list_bitmap); in free_journal_ram()
1885 free_bitmap_nodes(sb); /* must be after free_list_bitmaps */ in free_journal_ram()
1893 release_journal_dev(sb, journal); in free_journal_ram()
1902 struct super_block *sb, int error) in do_journal_release() argument
1905 struct reiserfs_journal *journal = SB_JOURNAL(sb); in do_journal_release()
1911 if (!error && !sb_rdonly(sb)) { in do_journal_release()
1920 if (!journal_join(&myth, sb)) { in do_journal_release()
1921 reiserfs_prepare_for_journal(sb, in do_journal_release()
1922 SB_BUFFER_WITH_SB(sb), in do_journal_release()
1924 journal_mark_dirty(&myth, SB_BUFFER_WITH_SB(sb)); in do_journal_release()
1932 if (!journal_join_abort(&myth, sb)) { in do_journal_release()
1933 reiserfs_prepare_for_journal(sb, in do_journal_release()
1934 SB_BUFFER_WITH_SB(sb), in do_journal_release()
1936 journal_mark_dirty(&myth, SB_BUFFER_WITH_SB(sb)); in do_journal_release()
1946 reiserfs_write_unlock(sb); in do_journal_release()
1953 reiserfs_cancel_old_flush(sb); in do_journal_release()
1955 cancel_delayed_work_sync(&SB_JOURNAL(sb)->j_work); in do_journal_release()
1957 free_journal_ram(sb); in do_journal_release()
1959 reiserfs_write_lock(sb); in do_journal_release()
1966 struct super_block *sb) in journal_release() argument
1968 return do_journal_release(th, sb, 0); in journal_release()
1973 struct super_block *sb) in journal_release_error() argument
1975 return do_journal_release(th, sb, 1); in journal_release_error()
1982 static int journal_compare_desc_commit(struct super_block *sb, in journal_compare_desc_commit() argument
1988 get_commit_trans_len(commit) > SB_JOURNAL(sb)->j_trans_max || in journal_compare_desc_commit()
2001 static int journal_transaction_is_valid(struct super_block *sb, in journal_transaction_is_valid() argument
2019 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_transaction_is_valid()
2029 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_transaction_is_valid()
2037 if (get_desc_trans_len(desc) > SB_JOURNAL(sb)->j_trans_max) { in journal_transaction_is_valid()
2038 reiserfs_warning(sb, "journal-2018", in journal_transaction_is_valid()
2044 offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb); in journal_transaction_is_valid()
2051 journal_bread(sb, in journal_transaction_is_valid()
2052 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_transaction_is_valid()
2054 1) % SB_ONDISK_JOURNAL_SIZE(sb))); in journal_transaction_is_valid()
2058 if (journal_compare_desc_commit(sb, desc, commit)) { in journal_transaction_is_valid()
2059 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_transaction_is_valid()
2063 SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_transaction_is_valid()
2070 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_transaction_is_valid()
2079 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_transaction_is_valid()
2083 SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_transaction_is_valid()
2106 static int journal_read_transaction(struct super_block *sb, in journal_read_transaction() argument
2112 struct reiserfs_journal *journal = SB_JOURNAL(sb); in journal_read_transaction()
2124 d_bh = journal_bread(sb, cur_dblock); in journal_read_transaction()
2128 trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb); in journal_read_transaction()
2129 reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1037: " in journal_read_transaction()
2131 d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_read_transaction()
2134 reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1039: " in journal_read_transaction()
2137 SB_ONDISK_JOURNAL_1st_BLOCK(sb)); in journal_read_transaction()
2142 reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1146: " in journal_read_transaction()
2149 c_bh = journal_bread(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read_transaction()
2151 SB_ONDISK_JOURNAL_SIZE(sb))); in journal_read_transaction()
2157 if (journal_compare_desc_commit(sb, desc, commit)) { in journal_read_transaction()
2158 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read_transaction()
2162 SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_read_transaction()
2170 if (bdev_read_only(sb->s_bdev)) { in journal_read_transaction()
2171 reiserfs_warning(sb, "clm-2076", in journal_read_transaction()
2194 reiserfs_warning(sb, "journal-1169", in journal_read_transaction()
2199 trans_half = journal_trans_half(sb->s_blocksize); in journal_read_transaction()
2202 journal_getblk(sb, in journal_read_transaction()
2203 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read_transaction()
2205 i) % SB_ONDISK_JOURNAL_SIZE(sb)); in journal_read_transaction()
2208 sb_getblk(sb, in journal_read_transaction()
2212 sb_getblk(sb, in journal_read_transaction()
2216 if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(sb)) { in journal_read_transaction()
2217 reiserfs_warning(sb, "journal-1207", in journal_read_transaction()
2225 (sb, real_blocks[i]->b_blocknr)) { in journal_read_transaction()
2226 reiserfs_warning(sb, "journal-1204", in journal_read_transaction()
2245 reiserfs_warning(sb, "journal-1212", in journal_read_transaction()
2270 reiserfs_warning(sb, "journal-1226", in journal_read_transaction()
2284 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read_transaction()
2286 2) % SB_ONDISK_JOURNAL_SIZE(sb)); in journal_read_transaction()
2287 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read_transaction()
2289 cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb)); in journal_read_transaction()
2295 journal->j_start = cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb); in journal_read_transaction()
2367 static int journal_read(struct super_block *sb) in journal_read() argument
2369 struct reiserfs_journal *journal = SB_JOURNAL(sb); in journal_read()
2384 cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(sb); in journal_read()
2385 reiserfs_info(sb, "checking transaction log (%pg)\n", in journal_read()
2394 journal->j_header_bh = journal_bread(sb, in journal_read()
2395 SB_ONDISK_JOURNAL_1st_BLOCK(sb) in journal_read()
2396 + SB_ONDISK_JOURNAL_SIZE(sb)); in journal_read()
2402 SB_ONDISK_JOURNAL_SIZE(sb) in journal_read()
2405 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read()
2409 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2422 journal_bread(sb, in journal_read()
2423 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read()
2425 ret = journal_transaction_is_valid(sb, d_bh, NULL, NULL); in journal_read()
2440 (SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read()
2441 SB_ONDISK_JOURNAL_SIZE(sb))) { in journal_read()
2448 sb->s_blocksize, in journal_read()
2449 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_read()
2450 SB_ONDISK_JOURNAL_SIZE(sb)); in journal_read()
2452 journal_transaction_is_valid(sb, d_bh, in journal_read()
2461 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2466 (sb), oldest_trans_id); in journal_read()
2471 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2476 (sb), oldest_trans_id); in journal_read()
2480 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2495 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2498 cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_read()
2505 journal_read_transaction(sb, cur_dblock, oldest_start, in journal_read()
2513 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + journal->j_start; in journal_read()
2520 reiserfs_debug(sb, REISERFS_DEBUG_CODE, in journal_read()
2542 reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1299: Setting " in journal_read()
2546 reiserfs_info(sb, in journal_read()
2551 reiserfs_write_lock(sb); in journal_read()
2552 if (!bdev_read_only(sb->s_bdev) && in journal_read()
2553 _update_journal_header_block(sb, journal->j_start, in journal_read()
2555 reiserfs_write_unlock(sb); in journal_read()
2562 reiserfs_write_unlock(sb); in journal_read()
2581 static void journal_list_init(struct super_block *sb) in journal_list_init() argument
2583 SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb); in journal_list_init()
2664 static int check_advise_trans_params(struct super_block *sb, in check_advise_trans_params() argument
2670 if (sb->s_blocksize < REISERFS_STANDARD_BLKSIZE) in check_advise_trans_params()
2671 ratio = REISERFS_STANDARD_BLKSIZE / sb->s_blocksize; in check_advise_trans_params()
2675 SB_ONDISK_JOURNAL_SIZE(sb) / journal->j_trans_max < in check_advise_trans_params()
2677 reiserfs_warning(sb, "sh-462", in check_advise_trans_params()
2684 reiserfs_warning(sb, "sh-463", in check_advise_trans_params()
2696 if (sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { in check_advise_trans_params()
2697 reiserfs_warning(sb, "sh-464", "bad blocksize (%u)", in check_advise_trans_params()
2698 sb->s_blocksize); in check_advise_trans_params()
2709 int journal_init(struct super_block *sb, const char *j_dev_name, in journal_init() argument
2712 int num_cnodes = SB_ONDISK_JOURNAL_SIZE(sb) * 2; in journal_init()
2720 journal = SB_JOURNAL(sb) = vzalloc(sizeof(struct reiserfs_journal)); in journal_init()
2722 reiserfs_warning(sb, "journal-1256", in journal_init()
2731 if (reiserfs_allocate_list_bitmaps(sb, journal->j_list_bitmap, in journal_init()
2732 reiserfs_bmap_count(sb))) in journal_init()
2735 allocate_bitmap_nodes(sb); in journal_init()
2738 SB_JOURNAL_1st_RESERVED_BLOCK(sb) = (old_format ? in journal_init()
2740 / sb->s_blocksize + in journal_init()
2741 reiserfs_bmap_count(sb) + in journal_init()
2744 sb->s_blocksize + 2); in journal_init()
2750 if (!SB_ONDISK_JOURNAL_DEVICE(sb) && in journal_init()
2751 (SB_JOURNAL_1st_RESERVED_BLOCK(sb) + in journal_init()
2752 SB_ONDISK_JOURNAL_SIZE(sb) > sb->s_blocksize * 8)) { in journal_init()
2753 reiserfs_warning(sb, "journal-1393", in journal_init()
2757 SB_JOURNAL_1st_RESERVED_BLOCK(sb), in journal_init()
2758 SB_ONDISK_JOURNAL_SIZE(sb), in journal_init()
2759 sb->s_blocksize); in journal_init()
2768 if (!SB_ONDISK_JOURNAL_DEVICE(sb) && in journal_init()
2769 SB_ONDISK_JOURNAL_1st_BLOCK(sb) < SB_JOURNAL_1st_RESERVED_BLOCK(sb)) { in journal_init()
2770 reiserfs_warning(sb, "journal-1393", in journal_init()
2772 SB_JOURNAL_1st_RESERVED_BLOCK(sb), in journal_init()
2773 SB_ONDISK_JOURNAL_1st_BLOCK(sb)); in journal_init()
2777 if (journal_init_dev(sb, journal, j_dev_name) != 0) { in journal_init()
2778 reiserfs_warning(sb, "sh-462", in journal_init()
2783 rs = SB_DISK_SUPER_BLOCK(sb); in journal_init()
2786 bhjh = journal_bread(sb, in journal_init()
2787 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in journal_init()
2788 SB_ONDISK_JOURNAL_SIZE(sb)); in journal_init()
2790 reiserfs_warning(sb, "sh-459", in journal_init()
2800 reiserfs_warning(sb, "sh-460", in journal_init()
2816 if (check_advise_trans_params(sb, journal) != 0) in journal_init()
2825 reiserfs_info(sb, "journal params: device %pg, size %u, " in journal_init()
2829 SB_ONDISK_JOURNAL_SIZE(sb), in journal_init()
2830 SB_ONDISK_JOURNAL_1st_BLOCK(sb), in journal_init()
2838 journal_list_init(sb); in journal_init()
2870 reiserfs_warning(sb, "journal-2004", "Journal cnode memory " in journal_init()
2878 init_journal_hash(sb); in journal_init()
2886 reiserfs_write_lock(sb); in journal_init()
2887 jl->j_list_bitmap = get_list_bitmap(sb, jl); in journal_init()
2888 reiserfs_write_unlock(sb); in journal_init()
2890 reiserfs_warning(sb, "journal-2005", in journal_init()
2895 ret = journal_read(sb); in journal_init()
2897 reiserfs_warning(sb, "reiserfs-2006", in journal_init()
2903 journal->j_work_sb = sb; in journal_init()
2906 free_journal_ram(sb); in journal_init()
2992 static void let_transaction_grow(struct super_block *sb, unsigned int trans_id) in let_transaction_grow() argument
2994 struct reiserfs_journal *journal = SB_JOURNAL(sb); in let_transaction_grow()
2999 depth = reiserfs_write_unlock_nested(sb); in let_transaction_grow()
3001 reiserfs_write_lock_nested(sb, depth); in let_transaction_grow()
3007 queue_log_writer(sb); in let_transaction_grow()
3025 struct super_block *sb, unsigned long nblocks, in do_journal_begin_r() argument
3030 struct reiserfs_journal *journal = SB_JOURNAL(sb); in do_journal_begin_r()
3036 reiserfs_check_lock_depth(sb, "journal_begin"); in do_journal_begin_r()
3039 PROC_INFO_INC(sb, journal.journal_being); in do_journal_begin_r()
3042 th->t_super = sb; in do_journal_begin_r()
3045 lock_journal(sb); in do_journal_begin_r()
3047 unlock_journal(sb); in do_journal_begin_r()
3054 unlock_journal(sb); in do_journal_begin_r()
3055 depth = reiserfs_write_unlock_nested(sb); in do_journal_begin_r()
3056 reiserfs_wait_on_write_block(sb); in do_journal_begin_r()
3057 reiserfs_write_lock_nested(sb, depth); in do_journal_begin_r()
3058 PROC_INFO_INC(sb, journal.journal_relock_writers); in do_journal_begin_r()
3082 unlock_journal(sb); in do_journal_begin_r()
3090 queue_log_writer(sb); in do_journal_begin_r()
3101 queue_log_writer(sb); in do_journal_begin_r()
3105 retval = journal_join(&myth, sb); in do_journal_begin_r()
3119 PROC_INFO_INC(sb, journal.journal_relock_wcount); in do_journal_begin_r()
3131 unlock_journal(sb); in do_journal_begin_r()
3142 th->t_super = sb; in do_journal_begin_r()
3194 struct super_block *sb) in journal_join() argument
3204 return do_journal_begin_r(th, sb, 1, JBEGIN_JOIN); in journal_join()
3208 struct super_block *sb) in journal_join_abort() argument
3218 return do_journal_begin_r(th, sb, 1, JBEGIN_ABORT); in journal_join_abort()
3222 struct super_block *sb, unsigned long nblocks) in journal_begin() argument
3230 if (cur_th->t_super == sb) { in journal_begin()
3235 reiserfs_warning(sb, "reiserfs-2005", in journal_begin()
3245 reiserfs_warning(sb, "clm-2100", in journal_begin()
3253 ret = do_journal_begin_r(th, sb, nblocks, JBEGIN_REG); in journal_begin()
3281 struct super_block *sb = th->t_super; in journal_mark_dirty() local
3282 struct reiserfs_journal *journal = SB_JOURNAL(sb); in journal_mark_dirty()
3288 PROC_INFO_INC(sb, journal.mark_dirty); in journal_mark_dirty()
3299 PROC_INFO_INC(sb, journal.mark_dirty_already); in journal_mark_dirty()
3309 reiserfs_warning(sb, "journal-1777", in journal_mark_dirty()
3320 reiserfs_warning(sb, "journal-1409", in journal_mark_dirty()
3338 PROC_INFO_INC(sb, journal.mark_dirty_notjournal); in journal_mark_dirty()
3350 cn = get_cnode(sb); in journal_mark_dirty()
3352 reiserfs_panic(sb, "journal-4", "get_cnode failed!"); in journal_mark_dirty()
3364 cn->sb = sb; in journal_mark_dirty()
3381 reiserfs_schedule_old_flush(sb); in journal_mark_dirty()
3387 struct super_block *sb = th->t_super; in journal_end() local
3389 reiserfs_warning(sb, "REISER-NESTING", in journal_end()
3426 static int remove_from_transaction(struct super_block *sb, in remove_from_transaction() argument
3431 struct reiserfs_journal *journal = SB_JOURNAL(sb); in remove_from_transaction()
3434 cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr); in remove_from_transaction()
3451 remove_journal_hash(sb, journal->j_hash_table, NULL, in remove_from_transaction()
3461 reiserfs_warning(sb, "journal-1752", in remove_from_transaction()
3468 free_cnode(sb, cn); in remove_from_transaction()
3485 struct super_block *sb = cn->sb; in can_dirty() local
3496 if (cur->jlist && cur->bh && cur->blocknr && cur->sb == sb && in can_dirty()
3510 cur->blocknr && cur->sb == sb && cur->blocknr == blocknr) { in can_dirty()
3524 struct super_block *sb = th->t_super; in journal_end_sync() local
3525 struct reiserfs_journal *journal = SB_JOURNAL(sb); in journal_end_sync()
3531 reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), in journal_end_sync()
3533 journal_mark_dirty(th, SB_BUFFER_WITH_SB(sb)); in journal_end_sync()
3543 struct super_block *sb = journal->j_work_sb; in flush_async_commits() local
3547 reiserfs_write_lock(sb); in flush_async_commits()
3552 flush_commit_list(sb, jl, 1); in flush_async_commits()
3554 reiserfs_write_unlock(sb); in flush_async_commits()
3561 void reiserfs_flush_old_commits(struct super_block *sb) in reiserfs_flush_old_commits() argument
3565 struct reiserfs_journal *journal = SB_JOURNAL(sb); in reiserfs_flush_old_commits()
3583 if (!journal_join(&th, sb)) { in reiserfs_flush_old_commits()
3584 reiserfs_prepare_for_journal(sb, in reiserfs_flush_old_commits()
3585 SB_BUFFER_WITH_SB(sb), in reiserfs_flush_old_commits()
3587 journal_mark_dirty(&th, SB_BUFFER_WITH_SB(sb)); in reiserfs_flush_old_commits()
3622 struct super_block *sb = th->t_super; in check_journal_end() local
3623 struct reiserfs_journal *journal = SB_JOURNAL(sb); in check_journal_end()
3666 unlock_journal(sb); in check_journal_end()
3674 queue_log_writer(sb); in check_journal_end()
3676 lock_journal(sb); in check_journal_end()
3681 unlock_journal(sb); in check_journal_end()
3687 && journal_list_still_alive(sb, trans_id) in check_journal_end()
3689 flush_commit_list(sb, jl, 1); in check_journal_end()
3693 unlock_journal(sb); in check_journal_end()
3710 unlock_journal(sb); in check_journal_end()
3714 if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(sb)) { in check_journal_end()
3715 reiserfs_panic(sb, "journal-003", in check_journal_end()
3740 struct super_block *sb, b_blocknr_t blocknr) in journal_mark_freed() argument
3742 struct reiserfs_journal *journal = SB_JOURNAL(sb); in journal_mark_freed()
3749 cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr); in journal_mark_freed()
3759 cleaned = remove_from_transaction(sb, blocknr, cleaned); in journal_mark_freed()
3767 reiserfs_panic(sb, "journal-1702", in journal_mark_freed()
3770 set_bit_in_list_bitmap(sb, blocknr, jb); in journal_mark_freed()
3778 cleaned = remove_from_transaction(sb, blocknr, cleaned); in journal_mark_freed()
3784 cn = get_journal_hash_dev(sb, journal->j_list_hash_table, in journal_mark_freed()
3787 if (sb == cn->sb && blocknr == cn->blocknr) { in journal_mark_freed()
3805 reiserfs_warning(sb, in journal_mark_freed()
3845 struct super_block *sb = inode->i_sb; in __commit_trans_jl() local
3846 struct reiserfs_journal *journal = SB_JOURNAL(sb); in __commit_trans_jl()
3859 let_transaction_grow(sb, id); in __commit_trans_jl()
3864 ret = journal_begin(&th, sb, 1); in __commit_trans_jl()
3870 reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), in __commit_trans_jl()
3872 journal_mark_dirty(&th, SB_BUFFER_WITH_SB(sb)); in __commit_trans_jl()
3896 flush_commit_list(sb, jl, 1); in __commit_trans_jl()
3923 void reiserfs_restore_prepared_buffer(struct super_block *sb, in reiserfs_restore_prepared_buffer() argument
3926 struct reiserfs_journal *journal = SB_JOURNAL(sb); in reiserfs_restore_prepared_buffer()
3927 PROC_INFO_INC(sb, journal.restore_prepared); in reiserfs_restore_prepared_buffer()
3934 reiserfs_write_lock(sb); in reiserfs_restore_prepared_buffer()
3935 cn = get_journal_hash_dev(sb, in reiserfs_restore_prepared_buffer()
3942 reiserfs_write_unlock(sb); in reiserfs_restore_prepared_buffer()
3954 int reiserfs_prepare_for_journal(struct super_block *sb, in reiserfs_prepare_for_journal() argument
3957 PROC_INFO_INC(sb, journal.prepare); in reiserfs_prepare_for_journal()
3985 struct super_block *sb = th->t_super; in do_journal_end() local
3986 struct reiserfs_journal *journal = SB_JOURNAL(sb); in do_journal_end()
4018 reiserfs_check_lock_depth(sb, "journal end"); in do_journal_end()
4020 reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), in do_journal_end()
4022 journal_mark_dirty(th, SB_BUFFER_WITH_SB(sb)); in do_journal_end()
4025 lock_journal(sb); in do_journal_end()
4041 reiserfs_schedule_old_flush(sb); in do_journal_end()
4042 wake_queued_writers(sb); in do_journal_end()
4043 reiserfs_async_progress_wait(sb); in do_journal_end()
4076 journal_getblk(sb, in do_journal_end()
4077 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in do_journal_end()
4089 c_bh = journal_getblk(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in do_journal_end()
4091 1) % SB_ONDISK_JOURNAL_SIZE(sb))); in do_journal_end()
4106 reiserfs_mutex_lock_safe(&jl->j_commit_mutex, sb); in do_journal_end()
4126 trans_half = journal_trans_half(sb->s_blocksize); in do_journal_end()
4129 jl_cn = get_cnode(sb); in do_journal_end()
4131 reiserfs_panic(sb, "journal-1676", in do_journal_end()
4148 (sb, cn->bh->b_blocknr)) { in do_journal_end()
4149 reiserfs_panic(sb, "journal-2332", in do_journal_end()
4156 jl_cn->sb = sb; in do_journal_end()
4204 journal_getblk(sb, in do_journal_end()
4205 SB_ONDISK_JOURNAL_1st_BLOCK(sb) + in do_journal_end()
4208 SB_ONDISK_JOURNAL_SIZE(sb))); in do_journal_end()
4225 reiserfs_warning(sb, "journal-2048", in do_journal_end()
4231 free_cnode(sb, cn); in do_journal_end()
4233 reiserfs_cond_resched(sb); in do_journal_end()
4242 journal->j_current_jl = alloc_journal_list(sb); in do_journal_end()
4252 2) % SB_ONDISK_JOURNAL_SIZE(sb); in do_journal_end()
4267 init_journal_hash(sb); in do_journal_end()
4283 depth = reiserfs_write_unlock_nested(sb); in do_journal_end()
4286 reiserfs_write_lock_nested(sb, depth); in do_journal_end()
4300 flush_commit_list(sb, jl, 1); in do_journal_end()
4301 flush_journal_list(sb, jl, 1); in do_journal_end()
4307 if (sb->s_flags & SB_ACTIVE) in do_journal_end()
4308 queue_delayed_work(REISERFS_SB(sb)->commit_wq, in do_journal_end()
4323 flush_used_journal_lists(sb, temp_jl); in do_journal_end()
4327 SB_ONDISK_JOURNAL_SIZE(sb)) { in do_journal_end()
4338 SB_ONDISK_JOURNAL_SIZE(sb)) { in do_journal_end()
4340 SB_ONDISK_JOURNAL_SIZE(sb)) >= in do_journal_end()
4342 flush_used_journal_lists(sb, temp_jl); in do_journal_end()
4357 get_list_bitmap(sb, journal->j_current_jl); in do_journal_end()
4360 reiserfs_panic(sb, "journal-1996", in do_journal_end()
4365 unlock_journal(sb); in do_journal_end()
4371 journal_list_still_alive(sb, commit_trans_id)) { in do_journal_end()
4372 flush_commit_list(sb, jl, 1); in do_journal_end()
4375 reiserfs_check_lock_depth(sb, "journal end2"); in do_journal_end()
4383 th->t_super = sb; in do_journal_end()
4389 void reiserfs_abort_journal(struct super_block *sb, int errno) in reiserfs_abort_journal() argument
4391 struct reiserfs_journal *journal = SB_JOURNAL(sb); in reiserfs_abort_journal()
4398 sb->s_flags |= SB_RDONLY; in reiserfs_abort_journal()