Skip to content

Commit ac4e78b

Browse files
committed
jfs: port block device access to file
Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 512383a commit ac4e78b

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

fs/jfs/jfs_logmgr.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ void jfs_syncpt(struct jfs_log *log, int hard_sync)
10581058
int lmLogOpen(struct super_block *sb)
10591059
{
10601060
int rc;
1061-
struct bdev_handle *bdev_handle;
1061+
struct file *bdev_file;
10621062
struct jfs_log *log;
10631063
struct jfs_sb_info *sbi = JFS_SBI(sb);
10641064

@@ -1070,7 +1070,7 @@ int lmLogOpen(struct super_block *sb)
10701070

10711071
mutex_lock(&jfs_log_mutex);
10721072
list_for_each_entry(log, &jfs_external_logs, journal_list) {
1073-
if (log->bdev_handle->bdev->bd_dev == sbi->logdev) {
1073+
if (file_bdev(log->bdev_file)->bd_dev == sbi->logdev) {
10741074
if (!uuid_equal(&log->uuid, &sbi->loguuid)) {
10751075
jfs_warn("wrong uuid on JFS journal");
10761076
mutex_unlock(&jfs_log_mutex);
@@ -1100,14 +1100,14 @@ int lmLogOpen(struct super_block *sb)
11001100
* file systems to log may have n-to-1 relationship;
11011101
*/
11021102

1103-
bdev_handle = bdev_open_by_dev(sbi->logdev,
1103+
bdev_file = bdev_file_open_by_dev(sbi->logdev,
11041104
BLK_OPEN_READ | BLK_OPEN_WRITE, log, NULL);
1105-
if (IS_ERR(bdev_handle)) {
1106-
rc = PTR_ERR(bdev_handle);
1105+
if (IS_ERR(bdev_file)) {
1106+
rc = PTR_ERR(bdev_file);
11071107
goto free;
11081108
}
11091109

1110-
log->bdev_handle = bdev_handle;
1110+
log->bdev_file = bdev_file;
11111111
uuid_copy(&log->uuid, &sbi->loguuid);
11121112

11131113
/*
@@ -1141,7 +1141,7 @@ int lmLogOpen(struct super_block *sb)
11411141
lbmLogShutdown(log);
11421142

11431143
close: /* close external log device */
1144-
bdev_release(bdev_handle);
1144+
fput(bdev_file);
11451145

11461146
free: /* free log descriptor */
11471147
mutex_unlock(&jfs_log_mutex);
@@ -1162,7 +1162,7 @@ static int open_inline_log(struct super_block *sb)
11621162
init_waitqueue_head(&log->syncwait);
11631163

11641164
set_bit(log_INLINELOG, &log->flag);
1165-
log->bdev_handle = sb_bdev_handle(sb);
1165+
log->bdev_file = sb->s_bdev_file;
11661166
log->base = addressPXD(&JFS_SBI(sb)->logpxd);
11671167
log->size = lengthPXD(&JFS_SBI(sb)->logpxd) >>
11681168
(L2LOGPSIZE - sb->s_blocksize_bits);
@@ -1436,7 +1436,7 @@ int lmLogClose(struct super_block *sb)
14361436
{
14371437
struct jfs_sb_info *sbi = JFS_SBI(sb);
14381438
struct jfs_log *log = sbi->log;
1439-
struct bdev_handle *bdev_handle;
1439+
struct file *bdev_file;
14401440
int rc = 0;
14411441

14421442
jfs_info("lmLogClose: log:0x%p", log);
@@ -1482,10 +1482,10 @@ int lmLogClose(struct super_block *sb)
14821482
* external log as separate logical volume
14831483
*/
14841484
list_del(&log->journal_list);
1485-
bdev_handle = log->bdev_handle;
1485+
bdev_file = log->bdev_file;
14861486
rc = lmLogShutdown(log);
14871487

1488-
bdev_release(bdev_handle);
1488+
fput(bdev_file);
14891489

14901490
kfree(log);
14911491

@@ -1972,7 +1972,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)
19721972

19731973
bp->l_flag |= lbmREAD;
19741974

1975-
bio = bio_alloc(log->bdev_handle->bdev, 1, REQ_OP_READ, GFP_NOFS);
1975+
bio = bio_alloc(file_bdev(log->bdev_file), 1, REQ_OP_READ, GFP_NOFS);
19761976
bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9);
19771977
__bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset);
19781978
BUG_ON(bio->bi_iter.bi_size != LOGPSIZE);
@@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp)
21152115
jfs_info("lbmStartIO");
21162116

21172117
if (!log->no_integrity)
2118-
bdev = log->bdev_handle->bdev;
2118+
bdev = file_bdev(log->bdev_file);
21192119

21202120
bio = bio_alloc(bdev, 1, REQ_OP_WRITE | REQ_SYNC,
21212121
GFP_NOFS);

fs/jfs/jfs_logmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ struct jfs_log {
356356
* before writing syncpt.
357357
*/
358358
struct list_head journal_list; /* Global list */
359-
struct bdev_handle *bdev_handle; /* 4: log lv pointer */
359+
struct file *bdev_file; /* 4: log lv pointer */
360360
int serial; /* 4: log mount serial number */
361361

362362
s64 base; /* @8: log extent address (inline log ) */

fs/jfs/jfs_mount.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ int updateSuper(struct super_block *sb, uint state)
431431
if (state == FM_MOUNT) {
432432
/* record log's dev_t and mount serial number */
433433
j_sb->s_logdev = cpu_to_le32(
434-
new_encode_dev(sbi->log->bdev_handle->bdev->bd_dev));
434+
new_encode_dev(file_bdev(sbi->log->bdev_file)->bd_dev));
435435
j_sb->s_logserial = cpu_to_le32(sbi->log->serial);
436436
} else if (state == FM_CLEAN) {
437437
/*

0 commit comments

Comments
 (0)