Commit 512383ae authored by Christian Brauner's avatar Christian Brauner
parent 61ead714
...@@ -1239,7 +1239,7 @@ struct f2fs_bio_info { ...@@ -1239,7 +1239,7 @@ struct f2fs_bio_info {
#define FDEV(i) (sbi->devs[i]) #define FDEV(i) (sbi->devs[i])
#define RDEV(i) (raw_super->devs[i]) #define RDEV(i) (raw_super->devs[i])
struct f2fs_dev_info { struct f2fs_dev_info {
struct bdev_handle *bdev_handle; struct file *bdev_file;
struct block_device *bdev; struct block_device *bdev;
char path[MAX_PATH_LEN]; char path[MAX_PATH_LEN];
unsigned int total_segments; unsigned int total_segments;
......
...@@ -1605,7 +1605,7 @@ static void destroy_device_list(struct f2fs_sb_info *sbi) ...@@ -1605,7 +1605,7 @@ static void destroy_device_list(struct f2fs_sb_info *sbi)
for (i = 0; i < sbi->s_ndevs; i++) { for (i = 0; i < sbi->s_ndevs; i++) {
if (i > 0) if (i > 0)
bdev_release(FDEV(i).bdev_handle); fput(FDEV(i).bdev_file);
#ifdef CONFIG_BLK_DEV_ZONED #ifdef CONFIG_BLK_DEV_ZONED
kvfree(FDEV(i).blkz_seq); kvfree(FDEV(i).blkz_seq);
#endif #endif
...@@ -4247,7 +4247,7 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi) ...@@ -4247,7 +4247,7 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
for (i = 0; i < max_devices; i++) { for (i = 0; i < max_devices; i++) {
if (i == 0) if (i == 0)
FDEV(0).bdev_handle = sb_bdev_handle(sbi->sb); FDEV(0).bdev_file = sbi->sb->s_bdev_file;
else if (!RDEV(i).path[0]) else if (!RDEV(i).path[0])
break; break;
...@@ -4267,14 +4267,14 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi) ...@@ -4267,14 +4267,14 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
FDEV(i).end_blk = FDEV(i).start_blk + FDEV(i).end_blk = FDEV(i).start_blk +
(FDEV(i).total_segments << (FDEV(i).total_segments <<
sbi->log_blocks_per_seg) - 1; sbi->log_blocks_per_seg) - 1;
FDEV(i).bdev_handle = bdev_open_by_path( FDEV(i).bdev_file = bdev_file_open_by_path(
FDEV(i).path, mode, sbi->sb, NULL); FDEV(i).path, mode, sbi->sb, NULL);
} }
} }
if (IS_ERR(FDEV(i).bdev_handle)) if (IS_ERR(FDEV(i).bdev_file))
return PTR_ERR(FDEV(i).bdev_handle); return PTR_ERR(FDEV(i).bdev_file);
FDEV(i).bdev = FDEV(i).bdev_handle->bdev; FDEV(i).bdev = file_bdev(FDEV(i).bdev_file);
/* to release errored devices */ /* to release errored devices */
sbi->s_ndevs = i + 1; sbi->s_ndevs = i + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment