@@ -213,7 +213,7 @@ struct o2hb_region {
213
213
unsigned int hr_num_pages ;
214
214
215
215
struct page * * hr_slot_data ;
216
- struct bdev_handle * hr_bdev_handle ;
216
+ struct file * hr_bdev_file ;
217
217
struct o2hb_disk_slot * hr_slots ;
218
218
219
219
/* live node map of this region */
@@ -263,7 +263,7 @@ struct o2hb_region {
263
263
264
264
static inline struct block_device * reg_bdev (struct o2hb_region * reg )
265
265
{
266
- return reg -> hr_bdev_handle ? reg -> hr_bdev_handle -> bdev : NULL ;
266
+ return reg -> hr_bdev_file ? file_bdev ( reg -> hr_bdev_file ) : NULL ;
267
267
}
268
268
269
269
struct o2hb_bio_wait_ctxt {
@@ -1509,8 +1509,8 @@ static void o2hb_region_release(struct config_item *item)
1509
1509
kfree (reg -> hr_slot_data );
1510
1510
}
1511
1511
1512
- if (reg -> hr_bdev_handle )
1513
- bdev_release (reg -> hr_bdev_handle );
1512
+ if (reg -> hr_bdev_file )
1513
+ fput (reg -> hr_bdev_file );
1514
1514
1515
1515
kfree (reg -> hr_slots );
1516
1516
@@ -1569,7 +1569,7 @@ static ssize_t o2hb_region_block_bytes_store(struct config_item *item,
1569
1569
unsigned long block_bytes ;
1570
1570
unsigned int block_bits ;
1571
1571
1572
- if (reg -> hr_bdev_handle )
1572
+ if (reg -> hr_bdev_file )
1573
1573
return - EINVAL ;
1574
1574
1575
1575
status = o2hb_read_block_input (reg , page , & block_bytes ,
@@ -1598,7 +1598,7 @@ static ssize_t o2hb_region_start_block_store(struct config_item *item,
1598
1598
char * p = (char * )page ;
1599
1599
ssize_t ret ;
1600
1600
1601
- if (reg -> hr_bdev_handle )
1601
+ if (reg -> hr_bdev_file )
1602
1602
return - EINVAL ;
1603
1603
1604
1604
ret = kstrtoull (p , 0 , & tmp );
@@ -1623,7 +1623,7 @@ static ssize_t o2hb_region_blocks_store(struct config_item *item,
1623
1623
unsigned long tmp ;
1624
1624
char * p = (char * )page ;
1625
1625
1626
- if (reg -> hr_bdev_handle )
1626
+ if (reg -> hr_bdev_file )
1627
1627
return - EINVAL ;
1628
1628
1629
1629
tmp = simple_strtoul (p , & p , 0 );
@@ -1642,7 +1642,7 @@ static ssize_t o2hb_region_dev_show(struct config_item *item, char *page)
1642
1642
{
1643
1643
unsigned int ret = 0 ;
1644
1644
1645
- if (to_o2hb_region (item )-> hr_bdev_handle )
1645
+ if (to_o2hb_region (item )-> hr_bdev_file )
1646
1646
ret = sprintf (page , "%pg\n" , reg_bdev (to_o2hb_region (item )));
1647
1647
1648
1648
return ret ;
@@ -1753,7 +1753,7 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
1753
1753
}
1754
1754
1755
1755
/*
1756
- * this is acting as commit; we set up all of hr_bdev_handle and hr_task or
1756
+ * this is acting as commit; we set up all of hr_bdev_file and hr_task or
1757
1757
* nothing
1758
1758
*/
1759
1759
static ssize_t o2hb_region_dev_store (struct config_item * item ,
@@ -1769,7 +1769,7 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
1769
1769
ssize_t ret = - EINVAL ;
1770
1770
int live_threshold ;
1771
1771
1772
- if (reg -> hr_bdev_handle )
1772
+ if (reg -> hr_bdev_file )
1773
1773
goto out ;
1774
1774
1775
1775
/* We can't heartbeat without having had our node number
@@ -1795,11 +1795,11 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
1795
1795
if (!S_ISBLK (f .file -> f_mapping -> host -> i_mode ))
1796
1796
goto out2 ;
1797
1797
1798
- reg -> hr_bdev_handle = bdev_open_by_dev (f .file -> f_mapping -> host -> i_rdev ,
1798
+ reg -> hr_bdev_file = bdev_file_open_by_dev (f .file -> f_mapping -> host -> i_rdev ,
1799
1799
BLK_OPEN_WRITE | BLK_OPEN_READ , NULL , NULL );
1800
- if (IS_ERR (reg -> hr_bdev_handle )) {
1801
- ret = PTR_ERR (reg -> hr_bdev_handle );
1802
- reg -> hr_bdev_handle = NULL ;
1800
+ if (IS_ERR (reg -> hr_bdev_file )) {
1801
+ ret = PTR_ERR (reg -> hr_bdev_file );
1802
+ reg -> hr_bdev_file = NULL ;
1803
1803
goto out2 ;
1804
1804
}
1805
1805
@@ -1903,8 +1903,8 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
1903
1903
1904
1904
out3 :
1905
1905
if (ret < 0 ) {
1906
- bdev_release (reg -> hr_bdev_handle );
1907
- reg -> hr_bdev_handle = NULL ;
1906
+ fput (reg -> hr_bdev_file );
1907
+ reg -> hr_bdev_file = NULL ;
1908
1908
}
1909
1909
out2 :
1910
1910
fdput (f );
0 commit comments