@@ -90,8 +90,7 @@ static int flush_commit_list(struct super_block *s,
9090static int can_dirty (struct reiserfs_journal_cnode * cn );
9191static int journal_join (struct reiserfs_transaction_handle * th ,
9292 struct super_block * sb );
93- static void release_journal_dev (struct super_block * super ,
94- struct reiserfs_journal * journal );
93+ static void release_journal_dev (struct reiserfs_journal * journal );
9594static void dirty_one_transaction (struct super_block * s ,
9695 struct reiserfs_journal_list * jl );
9796static void flush_async_commits (struct work_struct * work );
@@ -1893,7 +1892,7 @@ static void free_journal_ram(struct super_block *sb)
18931892 * j_header_bh is on the journal dev, make sure
18941893 * not to release the journal dev until we brelse j_header_bh
18951894 */
1896- release_journal_dev (sb , journal );
1895+ release_journal_dev (journal );
18971896 vfree (journal );
18981897}
18991898
@@ -2387,7 +2386,7 @@ static int journal_read(struct super_block *sb)
23872386
23882387 cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK (sb );
23892388 reiserfs_info (sb , "checking transaction log (%pg)\n" ,
2390- journal -> j_dev_bd );
2389+ journal -> j_bdev_handle -> bdev );
23912390 start = ktime_get_seconds ();
23922391
23932392 /*
@@ -2448,7 +2447,7 @@ static int journal_read(struct super_block *sb)
24482447 * device and journal device to be the same
24492448 */
24502449 d_bh =
2451- reiserfs_breada (journal -> j_dev_bd , cur_dblock ,
2450+ reiserfs_breada (journal -> j_bdev_handle -> bdev , cur_dblock ,
24522451 sb -> s_blocksize ,
24532452 SB_ONDISK_JOURNAL_1st_BLOCK (sb ) +
24542453 SB_ONDISK_JOURNAL_SIZE (sb ));
@@ -2587,17 +2586,11 @@ static void journal_list_init(struct super_block *sb)
25872586 SB_JOURNAL (sb )-> j_current_jl = alloc_journal_list (sb );
25882587}
25892588
2590- static void release_journal_dev (struct super_block * super ,
2591- struct reiserfs_journal * journal )
2589+ static void release_journal_dev (struct reiserfs_journal * journal )
25922590{
2593- if (journal -> j_dev_bd != NULL ) {
2594- void * holder = NULL ;
2595-
2596- if (journal -> j_dev_bd -> bd_dev != super -> s_dev )
2597- holder = journal ;
2598-
2599- blkdev_put (journal -> j_dev_bd , holder );
2600- journal -> j_dev_bd = NULL ;
2591+ if (journal -> j_bdev_handle ) {
2592+ bdev_release (journal -> j_bdev_handle );
2593+ journal -> j_bdev_handle = NULL ;
26012594 }
26022595}
26032596
@@ -2612,7 +2605,7 @@ static int journal_init_dev(struct super_block *super,
26122605
26132606 result = 0 ;
26142607
2615- journal -> j_dev_bd = NULL ;
2608+ journal -> j_bdev_handle = NULL ;
26162609 jdev = SB_ONDISK_JOURNAL_DEVICE (super ) ?
26172610 new_decode_dev (SB_ONDISK_JOURNAL_DEVICE (super )) : super -> s_dev ;
26182611
@@ -2623,36 +2616,37 @@ static int journal_init_dev(struct super_block *super,
26232616 if ((!jdev_name || !jdev_name [0 ])) {
26242617 if (jdev == super -> s_dev )
26252618 holder = NULL ;
2626- journal -> j_dev_bd = blkdev_get_by_dev (jdev , blkdev_mode , holder ,
2627- NULL );
2628- if (IS_ERR (journal -> j_dev_bd )) {
2629- result = PTR_ERR (journal -> j_dev_bd );
2630- journal -> j_dev_bd = NULL ;
2619+ journal -> j_bdev_handle = bdev_open_by_dev (jdev , blkdev_mode ,
2620+ holder , NULL );
2621+ if (IS_ERR (journal -> j_bdev_handle )) {
2622+ result = PTR_ERR (journal -> j_bdev_handle );
2623+ journal -> j_bdev_handle = NULL ;
26312624 reiserfs_warning (super , "sh-458" ,
26322625 "cannot init journal device unknown-block(%u,%u): %i" ,
26332626 MAJOR (jdev ), MINOR (jdev ), result );
26342627 return result ;
26352628 } else if (jdev != super -> s_dev )
2636- set_blocksize (journal -> j_dev_bd , super -> s_blocksize );
2629+ set_blocksize (journal -> j_bdev_handle -> bdev ,
2630+ super -> s_blocksize );
26372631
26382632 return 0 ;
26392633 }
26402634
2641- journal -> j_dev_bd = blkdev_get_by_path (jdev_name , blkdev_mode , holder ,
2642- NULL );
2643- if (IS_ERR (journal -> j_dev_bd )) {
2644- result = PTR_ERR (journal -> j_dev_bd );
2645- journal -> j_dev_bd = NULL ;
2635+ journal -> j_bdev_handle = bdev_open_by_path (jdev_name , blkdev_mode ,
2636+ holder , NULL );
2637+ if (IS_ERR (journal -> j_bdev_handle )) {
2638+ result = PTR_ERR (journal -> j_bdev_handle );
2639+ journal -> j_bdev_handle = NULL ;
26462640 reiserfs_warning (super , "sh-457" ,
26472641 "journal_init_dev: Cannot open '%s': %i" ,
26482642 jdev_name , result );
26492643 return result ;
26502644 }
26512645
2652- set_blocksize (journal -> j_dev_bd , super -> s_blocksize );
2646+ set_blocksize (journal -> j_bdev_handle -> bdev , super -> s_blocksize );
26532647 reiserfs_info (super ,
26542648 "journal_init_dev: journal device: %pg\n" ,
2655- journal -> j_dev_bd );
2649+ journal -> j_bdev_handle -> bdev );
26562650 return 0 ;
26572651}
26582652
@@ -2810,7 +2804,7 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
28102804 "journal header magic %x (device %pg) does "
28112805 "not match to magic found in super block %x" ,
28122806 jh -> jh_journal .jp_journal_magic ,
2813- journal -> j_dev_bd ,
2807+ journal -> j_bdev_handle -> bdev ,
28142808 sb_jp_journal_magic (rs ));
28152809 brelse (bhjh );
28162810 goto free_and_return ;
@@ -2834,7 +2828,7 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
28342828 reiserfs_info (sb , "journal params: device %pg, size %u, "
28352829 "journal first block %u, max trans len %u, max batch %u, "
28362830 "max commit age %u, max trans age %u\n" ,
2837- journal -> j_dev_bd ,
2831+ journal -> j_bdev_handle -> bdev ,
28382832 SB_ONDISK_JOURNAL_SIZE (sb ),
28392833 SB_ONDISK_JOURNAL_1st_BLOCK (sb ),
28402834 journal -> j_trans_max ,
0 commit comments