@@ -1359,14 +1359,14 @@ static void ext4_put_super(struct super_block *sb)
1359
1359
1360
1360
sync_blockdev (sb -> s_bdev );
1361
1361
invalidate_bdev (sb -> s_bdev );
1362
- if (sbi -> s_journal_bdev_handle ) {
1362
+ if (sbi -> s_journal_bdev_file ) {
1363
1363
/*
1364
1364
* Invalidate the journal device's buffers. We don't want them
1365
1365
* floating about in memory - the physical journal device may
1366
1366
* hotswapped, and it breaks the `ro-after' testing code.
1367
1367
*/
1368
- sync_blockdev (sbi -> s_journal_bdev_handle -> bdev );
1369
- invalidate_bdev (sbi -> s_journal_bdev_handle -> bdev );
1368
+ sync_blockdev (file_bdev ( sbi -> s_journal_bdev_file ) );
1369
+ invalidate_bdev (file_bdev ( sbi -> s_journal_bdev_file ) );
1370
1370
}
1371
1371
1372
1372
ext4_xattr_destroy_cache (sbi -> s_ea_inode_cache );
@@ -4233,7 +4233,7 @@ int ext4_calculate_overhead(struct super_block *sb)
4233
4233
* Add the internal journal blocks whether the journal has been
4234
4234
* loaded or not
4235
4235
*/
4236
- if (sbi -> s_journal && !sbi -> s_journal_bdev_handle )
4236
+ if (sbi -> s_journal && !sbi -> s_journal_bdev_file )
4237
4237
overhead += EXT4_NUM_B2C (sbi , sbi -> s_journal -> j_total_len );
4238
4238
else if (ext4_has_feature_journal (sb ) && !sbi -> s_journal && j_inum ) {
4239
4239
/* j_inum for internal journal is non-zero */
@@ -5670,9 +5670,9 @@ failed_mount9: __maybe_unused
5670
5670
#endif
5671
5671
fscrypt_free_dummy_policy (& sbi -> s_dummy_enc_policy );
5672
5672
brelse (sbi -> s_sbh );
5673
- if (sbi -> s_journal_bdev_handle ) {
5674
- invalidate_bdev (sbi -> s_journal_bdev_handle -> bdev );
5675
- bdev_release (sbi -> s_journal_bdev_handle );
5673
+ if (sbi -> s_journal_bdev_file ) {
5674
+ invalidate_bdev (file_bdev ( sbi -> s_journal_bdev_file ) );
5675
+ fput (sbi -> s_journal_bdev_file );
5676
5676
}
5677
5677
out_fail :
5678
5678
invalidate_bdev (sb -> s_bdev );
@@ -5842,30 +5842,30 @@ static journal_t *ext4_open_inode_journal(struct super_block *sb,
5842
5842
return journal ;
5843
5843
}
5844
5844
5845
- static struct bdev_handle * ext4_get_journal_blkdev (struct super_block * sb ,
5845
+ static struct file * ext4_get_journal_blkdev (struct super_block * sb ,
5846
5846
dev_t j_dev , ext4_fsblk_t * j_start ,
5847
5847
ext4_fsblk_t * j_len )
5848
5848
{
5849
5849
struct buffer_head * bh ;
5850
5850
struct block_device * bdev ;
5851
- struct bdev_handle * bdev_handle ;
5851
+ struct file * bdev_file ;
5852
5852
int hblock , blocksize ;
5853
5853
ext4_fsblk_t sb_block ;
5854
5854
unsigned long offset ;
5855
5855
struct ext4_super_block * es ;
5856
5856
int errno ;
5857
5857
5858
- bdev_handle = bdev_open_by_dev (j_dev ,
5858
+ bdev_file = bdev_file_open_by_dev (j_dev ,
5859
5859
BLK_OPEN_READ | BLK_OPEN_WRITE | BLK_OPEN_RESTRICT_WRITES ,
5860
5860
sb , & fs_holder_ops );
5861
- if (IS_ERR (bdev_handle )) {
5861
+ if (IS_ERR (bdev_file )) {
5862
5862
ext4_msg (sb , KERN_ERR ,
5863
5863
"failed to open journal device unknown-block(%u,%u) %ld" ,
5864
- MAJOR (j_dev ), MINOR (j_dev ), PTR_ERR (bdev_handle ));
5865
- return bdev_handle ;
5864
+ MAJOR (j_dev ), MINOR (j_dev ), PTR_ERR (bdev_file ));
5865
+ return bdev_file ;
5866
5866
}
5867
5867
5868
- bdev = bdev_handle -> bdev ;
5868
+ bdev = file_bdev ( bdev_file ) ;
5869
5869
blocksize = sb -> s_blocksize ;
5870
5870
hblock = bdev_logical_block_size (bdev );
5871
5871
if (blocksize < hblock ) {
@@ -5912,12 +5912,12 @@ static struct bdev_handle *ext4_get_journal_blkdev(struct super_block *sb,
5912
5912
* j_start = sb_block + 1 ;
5913
5913
* j_len = ext4_blocks_count (es );
5914
5914
brelse (bh );
5915
- return bdev_handle ;
5915
+ return bdev_file ;
5916
5916
5917
5917
out_bh :
5918
5918
brelse (bh );
5919
5919
out_bdev :
5920
- bdev_release ( bdev_handle );
5920
+ fput ( bdev_file );
5921
5921
return ERR_PTR (errno );
5922
5922
}
5923
5923
@@ -5927,14 +5927,14 @@ static journal_t *ext4_open_dev_journal(struct super_block *sb,
5927
5927
journal_t * journal ;
5928
5928
ext4_fsblk_t j_start ;
5929
5929
ext4_fsblk_t j_len ;
5930
- struct bdev_handle * bdev_handle ;
5930
+ struct file * bdev_file ;
5931
5931
int errno = 0 ;
5932
5932
5933
- bdev_handle = ext4_get_journal_blkdev (sb , j_dev , & j_start , & j_len );
5934
- if (IS_ERR (bdev_handle ))
5935
- return ERR_CAST (bdev_handle );
5933
+ bdev_file = ext4_get_journal_blkdev (sb , j_dev , & j_start , & j_len );
5934
+ if (IS_ERR (bdev_file ))
5935
+ return ERR_CAST (bdev_file );
5936
5936
5937
- journal = jbd2_journal_init_dev (bdev_handle -> bdev , sb -> s_bdev , j_start ,
5937
+ journal = jbd2_journal_init_dev (file_bdev ( bdev_file ) , sb -> s_bdev , j_start ,
5938
5938
j_len , sb -> s_blocksize );
5939
5939
if (IS_ERR (journal )) {
5940
5940
ext4_msg (sb , KERN_ERR , "failed to create device journal" );
@@ -5949,14 +5949,14 @@ static journal_t *ext4_open_dev_journal(struct super_block *sb,
5949
5949
goto out_journal ;
5950
5950
}
5951
5951
journal -> j_private = sb ;
5952
- EXT4_SB (sb )-> s_journal_bdev_handle = bdev_handle ;
5952
+ EXT4_SB (sb )-> s_journal_bdev_file = bdev_file ;
5953
5953
ext4_init_journal_params (sb , journal );
5954
5954
return journal ;
5955
5955
5956
5956
out_journal :
5957
5957
jbd2_journal_destroy (journal );
5958
5958
out_bdev :
5959
- bdev_release ( bdev_handle );
5959
+ fput ( bdev_file );
5960
5960
return ERR_PTR (errno );
5961
5961
}
5962
5962
@@ -7314,12 +7314,12 @@ static inline int ext3_feature_set_ok(struct super_block *sb)
7314
7314
static void ext4_kill_sb (struct super_block * sb )
7315
7315
{
7316
7316
struct ext4_sb_info * sbi = EXT4_SB (sb );
7317
- struct bdev_handle * handle = sbi ? sbi -> s_journal_bdev_handle : NULL ;
7317
+ struct file * bdev_file = sbi ? sbi -> s_journal_bdev_file : NULL ;
7318
7318
7319
7319
kill_block_super (sb );
7320
7320
7321
- if (handle )
7322
- bdev_release ( handle );
7321
+ if (bdev_file )
7322
+ fput ( bdev_file );
7323
7323
}
7324
7324
7325
7325
static struct file_system_type ext4_fs_type = {
0 commit comments