@@ -92,10 +92,6 @@ static struct o2hb_debug_buf *o2hb_db_failedregions;
9292#define O2HB_DEBUG_REGION_PINNED "pinned"
9393
9494static struct dentry * o2hb_debug_dir ;
95- static struct dentry * o2hb_debug_livenodes ;
96- static struct dentry * o2hb_debug_liveregions ;
97- static struct dentry * o2hb_debug_quorumregions ;
98- static struct dentry * o2hb_debug_failedregions ;
9995
10096static LIST_HEAD (o2hb_all_regions );
10197
@@ -1391,11 +1387,7 @@ static const struct file_operations o2hb_debug_fops = {
13911387
13921388void o2hb_exit (void )
13931389{
1394- debugfs_remove (o2hb_debug_failedregions );
1395- debugfs_remove (o2hb_debug_quorumregions );
1396- debugfs_remove (o2hb_debug_liveregions );
1397- debugfs_remove (o2hb_debug_livenodes );
1398- debugfs_remove (o2hb_debug_dir );
1390+ debugfs_remove_recursive (o2hb_debug_dir );
13991391 kfree (o2hb_db_livenodes );
14001392 kfree (o2hb_db_liveregions );
14011393 kfree (o2hb_db_quorumregions );
@@ -1419,79 +1411,37 @@ static struct dentry *o2hb_debug_create(const char *name, struct dentry *dir,
14191411 & o2hb_debug_fops );
14201412}
14211413
1422- static int o2hb_debug_init (void )
1414+ static void o2hb_debug_init (void )
14231415{
1424- int ret = - ENOMEM ;
1425-
14261416 o2hb_debug_dir = debugfs_create_dir (O2HB_DEBUG_DIR , NULL );
1427- if (!o2hb_debug_dir ) {
1428- mlog_errno (ret );
1429- goto bail ;
1430- }
14311417
1432- o2hb_debug_livenodes = o2hb_debug_create (O2HB_DEBUG_LIVENODES ,
1433- o2hb_debug_dir ,
1434- & o2hb_db_livenodes ,
1435- sizeof (* o2hb_db_livenodes ),
1436- O2HB_DB_TYPE_LIVENODES ,
1437- sizeof (o2hb_live_node_bitmap ),
1438- O2NM_MAX_NODES ,
1439- o2hb_live_node_bitmap );
1440- if (!o2hb_debug_livenodes ) {
1441- mlog_errno (ret );
1442- goto bail ;
1443- }
1418+ o2hb_debug_create (O2HB_DEBUG_LIVENODES , o2hb_debug_dir ,
1419+ & o2hb_db_livenodes , sizeof (* o2hb_db_livenodes ),
1420+ O2HB_DB_TYPE_LIVENODES , sizeof (o2hb_live_node_bitmap ),
1421+ O2NM_MAX_NODES , o2hb_live_node_bitmap );
14441422
1445- o2hb_debug_liveregions = o2hb_debug_create (O2HB_DEBUG_LIVEREGIONS ,
1446- o2hb_debug_dir ,
1447- & o2hb_db_liveregions ,
1448- sizeof (* o2hb_db_liveregions ),
1449- O2HB_DB_TYPE_LIVEREGIONS ,
1450- sizeof (o2hb_live_region_bitmap ),
1451- O2NM_MAX_REGIONS ,
1452- o2hb_live_region_bitmap );
1453- if (!o2hb_debug_liveregions ) {
1454- mlog_errno (ret );
1455- goto bail ;
1456- }
1423+ o2hb_debug_create (O2HB_DEBUG_LIVEREGIONS , o2hb_debug_dir ,
1424+ & o2hb_db_liveregions , sizeof (* o2hb_db_liveregions ),
1425+ O2HB_DB_TYPE_LIVEREGIONS ,
1426+ sizeof (o2hb_live_region_bitmap ), O2NM_MAX_REGIONS ,
1427+ o2hb_live_region_bitmap );
14571428
1458- o2hb_debug_quorumregions =
1459- o2hb_debug_create (O2HB_DEBUG_QUORUMREGIONS ,
1460- o2hb_debug_dir ,
1461- & o2hb_db_quorumregions ,
1462- sizeof (* o2hb_db_quorumregions ),
1463- O2HB_DB_TYPE_QUORUMREGIONS ,
1464- sizeof (o2hb_quorum_region_bitmap ),
1465- O2NM_MAX_REGIONS ,
1466- o2hb_quorum_region_bitmap );
1467- if (!o2hb_debug_quorumregions ) {
1468- mlog_errno (ret );
1469- goto bail ;
1470- }
1471-
1472- o2hb_debug_failedregions =
1473- o2hb_debug_create (O2HB_DEBUG_FAILEDREGIONS ,
1474- o2hb_debug_dir ,
1475- & o2hb_db_failedregions ,
1476- sizeof (* o2hb_db_failedregions ),
1477- O2HB_DB_TYPE_FAILEDREGIONS ,
1478- sizeof (o2hb_failed_region_bitmap ),
1479- O2NM_MAX_REGIONS ,
1480- o2hb_failed_region_bitmap );
1481- if (!o2hb_debug_failedregions ) {
1482- mlog_errno (ret );
1483- goto bail ;
1484- }
1429+ o2hb_debug_create (O2HB_DEBUG_QUORUMREGIONS , o2hb_debug_dir ,
1430+ & o2hb_db_quorumregions ,
1431+ sizeof (* o2hb_db_quorumregions ),
1432+ O2HB_DB_TYPE_QUORUMREGIONS ,
1433+ sizeof (o2hb_quorum_region_bitmap ), O2NM_MAX_REGIONS ,
1434+ o2hb_quorum_region_bitmap );
14851435
1486- ret = 0 ;
1487- bail :
1488- if ( ret )
1489- o2hb_exit ();
1490-
1491- return ret ;
1436+ o2hb_debug_create ( O2HB_DEBUG_FAILEDREGIONS , o2hb_debug_dir ,
1437+ & o2hb_db_failedregions ,
1438+ sizeof ( * o2hb_db_failedregions ),
1439+ O2HB_DB_TYPE_FAILEDREGIONS ,
1440+ sizeof ( o2hb_failed_region_bitmap ), O2NM_MAX_REGIONS ,
1441+ o2hb_failed_region_bitmap ) ;
14921442}
14931443
1494- int o2hb_init (void )
1444+ void o2hb_init (void )
14951445{
14961446 int i ;
14971447
@@ -1511,7 +1461,7 @@ int o2hb_init(void)
15111461
15121462 o2hb_dependent_users = 0 ;
15131463
1514- return o2hb_debug_init ();
1464+ o2hb_debug_init ();
15151465}
15161466
15171467/* if we're already in a callback then we're already serialized by the sem */
0 commit comments