Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a8167db

Browse files
committed
Revert "jfs: Convert to bdev_open_by_dev()"
This reverts commit 9641706 which is commit 898c57f upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Ic492873afc380526d2eca3276ec94c6c61156d30 Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a1f8d07 commit a8167db

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

fs/jfs/jfs_logmgr.c

Lines changed: 14 additions & 15 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 block_device *bdev;
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 (log->bdev->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,
1104-
BLK_OPEN_READ | BLK_OPEN_WRITE, log, NULL);
1105-
if (IS_ERR(bdev_handle)) {
1106-
rc = PTR_ERR(bdev_handle);
1103+
bdev = blkdev_get_by_dev(sbi->logdev, BLK_OPEN_READ | BLK_OPEN_WRITE,
1104+
log, NULL);
1105+
if (IS_ERR(bdev)) {
1106+
rc = PTR_ERR(bdev);
11071107
goto free;
11081108
}
11091109

1110-
log->bdev_handle = bdev_handle;
1110+
log->bdev = bdev;
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+
blkdev_put(bdev, log);
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->s_bdev_handle;
1165+
log->bdev = sb->s_bdev;
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 block_device *bdev;
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 = log->bdev;
14861486
rc = lmLogShutdown(log);
14871487

1488-
bdev_release(bdev_handle);
1488+
blkdev_put(bdev, log);
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(log->bdev, 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);
@@ -2113,8 +2113,7 @@ static void lbmStartIO(struct lbuf * bp)
21132113

21142114
jfs_info("lbmStartIO");
21152115

2116-
bio = bio_alloc(log->bdev_handle->bdev, 1, REQ_OP_WRITE | REQ_SYNC,
2117-
GFP_NOFS);
2116+
bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS);
21182117
bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9);
21192118
__bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset);
21202119
BUG_ON(bio->bi_iter.bi_size != LOGPSIZE);

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 block_device *bdev; /* 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,7 @@ int updateSuper(struct super_block *sb, uint state)
430430

431431
if (state == FM_MOUNT) {
432432
/* record log's dev_t and mount serial number */
433-
j_sb->s_logdev = cpu_to_le32(
434-
new_encode_dev(sbi->log->bdev_handle->bdev->bd_dev));
433+
j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev));
435434
j_sb->s_logserial = cpu_to_le32(sbi->log->serial);
436435
} else if (state == FM_CLEAN) {
437436
/*

0 commit comments

Comments
 (0)