diff options
Diffstat (limited to '')
-rw-r--r-- | fs/reiserfs/journal.c | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 015bfe4e45..171c912af5 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -90,8 +90,7 @@ static int flush_commit_list(struct super_block *s, static int can_dirty(struct reiserfs_journal_cnode *cn); static int journal_join(struct reiserfs_transaction_handle *th, struct super_block *sb); -static void release_journal_dev(struct super_block *super, - struct reiserfs_journal *journal); +static void release_journal_dev(struct reiserfs_journal *journal); static void dirty_one_transaction(struct super_block *s, struct reiserfs_journal_list *jl); static void flush_async_commits(struct work_struct *work); @@ -1893,7 +1892,7 @@ static void free_journal_ram(struct super_block *sb) * j_header_bh is on the journal dev, make sure * not to release the journal dev until we brelse j_header_bh */ - release_journal_dev(sb, journal); + release_journal_dev(journal); vfree(journal); } @@ -2387,7 +2386,7 @@ static int journal_read(struct super_block *sb) cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(sb); reiserfs_info(sb, "checking transaction log (%pg)\n", - journal->j_dev_bd); + journal->j_bdev_handle->bdev); start = ktime_get_seconds(); /* @@ -2448,7 +2447,7 @@ static int journal_read(struct super_block *sb) * device and journal device to be the same */ d_bh = - reiserfs_breada(journal->j_dev_bd, cur_dblock, + reiserfs_breada(journal->j_bdev_handle->bdev, cur_dblock, sb->s_blocksize, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + SB_ONDISK_JOURNAL_SIZE(sb)); @@ -2587,17 +2586,11 @@ static void journal_list_init(struct super_block *sb) SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb); } -static void release_journal_dev(struct super_block *super, - struct reiserfs_journal *journal) +static void release_journal_dev(struct reiserfs_journal *journal) { - if (journal->j_dev_bd != NULL) { - void *holder = NULL; - - if (journal->j_dev_bd->bd_dev != super->s_dev) - holder = journal; - - blkdev_put(journal->j_dev_bd, holder); - journal->j_dev_bd = NULL; + if (journal->j_bdev_handle) { + bdev_release(journal->j_bdev_handle); + journal->j_bdev_handle = NULL; } } @@ -2612,7 +2605,7 @@ static int journal_init_dev(struct super_block *super, result = 0; - journal->j_dev_bd = NULL; + journal->j_bdev_handle = NULL; jdev = SB_ONDISK_JOURNAL_DEVICE(super) ? new_decode_dev(SB_ONDISK_JOURNAL_DEVICE(super)) : super->s_dev; @@ -2623,36 +2616,37 @@ static int journal_init_dev(struct super_block *super, if ((!jdev_name || !jdev_name[0])) { if (jdev == super->s_dev) holder = NULL; - journal->j_dev_bd = blkdev_get_by_dev(jdev, blkdev_mode, holder, - NULL); - if (IS_ERR(journal->j_dev_bd)) { - result = PTR_ERR(journal->j_dev_bd); - journal->j_dev_bd = NULL; + journal->j_bdev_handle = bdev_open_by_dev(jdev, blkdev_mode, + holder, NULL); + if (IS_ERR(journal->j_bdev_handle)) { + result = PTR_ERR(journal->j_bdev_handle); + journal->j_bdev_handle = NULL; reiserfs_warning(super, "sh-458", "cannot init journal device unknown-block(%u,%u): %i", MAJOR(jdev), MINOR(jdev), result); return result; } else if (jdev != super->s_dev) - set_blocksize(journal->j_dev_bd, super->s_blocksize); + set_blocksize(journal->j_bdev_handle->bdev, + super->s_blocksize); return 0; } - journal->j_dev_bd = blkdev_get_by_path(jdev_name, blkdev_mode, holder, - NULL); - if (IS_ERR(journal->j_dev_bd)) { - result = PTR_ERR(journal->j_dev_bd); - journal->j_dev_bd = NULL; + journal->j_bdev_handle = bdev_open_by_path(jdev_name, blkdev_mode, + holder, NULL); + if (IS_ERR(journal->j_bdev_handle)) { + result = PTR_ERR(journal->j_bdev_handle); + journal->j_bdev_handle = NULL; reiserfs_warning(super, "sh-457", "journal_init_dev: Cannot open '%s': %i", jdev_name, result); return result; } - set_blocksize(journal->j_dev_bd, super->s_blocksize); + set_blocksize(journal->j_bdev_handle->bdev, super->s_blocksize); reiserfs_info(super, "journal_init_dev: journal device: %pg\n", - journal->j_dev_bd); + journal->j_bdev_handle->bdev); return 0; } @@ -2810,7 +2804,7 @@ int journal_init(struct super_block *sb, const char *j_dev_name, "journal header magic %x (device %pg) does " "not match to magic found in super block %x", jh->jh_journal.jp_journal_magic, - journal->j_dev_bd, + journal->j_bdev_handle->bdev, sb_jp_journal_magic(rs)); brelse(bhjh); goto free_and_return; @@ -2834,7 +2828,7 @@ int journal_init(struct super_block *sb, const char *j_dev_name, reiserfs_info(sb, "journal params: device %pg, size %u, " "journal first block %u, max trans len %u, max batch %u, " "max commit age %u, max trans age %u\n", - journal->j_dev_bd, + journal->j_bdev_handle->bdev, SB_ONDISK_JOURNAL_SIZE(sb), SB_ONDISK_JOURNAL_1st_BLOCK(sb), journal->j_trans_max, |