@@ -802,7 +802,6 @@ static unsigned long descriptor_loc(struct super_block *sb,
802
802
803
803
static int ext2_fill_super (struct super_block * sb , void * data , int silent )
804
804
{
805
- struct dax_device * dax_dev = fs_dax_get_by_bdev (sb -> s_bdev );
806
805
struct buffer_head * bh ;
807
806
struct ext2_sb_info * sbi ;
808
807
struct ext2_super_block * es ;
@@ -822,17 +821,17 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
822
821
823
822
sbi = kzalloc (sizeof (* sbi ), GFP_KERNEL );
824
823
if (!sbi )
825
- goto failed ;
824
+ return - ENOMEM ;
826
825
827
826
sbi -> s_blockgroup_lock =
828
827
kzalloc (sizeof (struct blockgroup_lock ), GFP_KERNEL );
829
828
if (!sbi -> s_blockgroup_lock ) {
830
829
kfree (sbi );
831
- goto failed ;
830
+ return - ENOMEM ;
832
831
}
833
832
sb -> s_fs_info = sbi ;
834
833
sbi -> s_sb_block = sb_block ;
835
- sbi -> s_daxdev = dax_dev ;
834
+ sbi -> s_daxdev = fs_dax_get_by_bdev ( sb -> s_bdev ) ;
836
835
837
836
spin_lock_init (& sbi -> s_lock );
838
837
ret = - EINVAL ;
@@ -946,7 +945,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
946
945
blocksize = BLOCK_SIZE << le32_to_cpu (sbi -> s_es -> s_log_block_size );
947
946
948
947
if (test_opt (sb , DAX )) {
949
- if (!dax_dev ) {
948
+ if (!sbi -> s_daxdev ) {
950
949
ext2_msg (sb , KERN_ERR ,
951
950
"DAX unsupported by block device. Turning off DAX." );
952
951
clear_opt (sbi -> s_mount_opt , DAX );
@@ -1201,11 +1200,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
1201
1200
failed_mount :
1202
1201
brelse (bh );
1203
1202
failed_sbi :
1203
+ fs_put_dax (sbi -> s_daxdev );
1204
1204
sb -> s_fs_info = NULL ;
1205
1205
kfree (sbi -> s_blockgroup_lock );
1206
1206
kfree (sbi );
1207
- failed :
1208
- fs_put_dax (dax_dev );
1209
1207
return ret ;
1210
1208
}
1211
1209
0 commit comments