@@ -134,7 +134,7 @@ class BlueFS::SocketHook : public AdminSocketHook {
134134 f->open_object_section (" dev" );
135135 f->dump_string (" device" , bluefs->get_device_name (dev));
136136 ceph_assert (bluefs->alloc [dev]);
137- auto total = bluefs->get_total (dev);
137+ auto total = bluefs->get_block_device_size (dev);
138138 auto free = bluefs->get_free (dev);
139139 auto used = bluefs->get_used (dev);
140140
@@ -480,15 +480,15 @@ void BlueFS::_shutdown_logger()
480480void BlueFS::_update_logger_stats ()
481481{
482482 if (alloc[BDEV_WAL]) {
483- logger->set (l_bluefs_wal_total_bytes, _get_total (BDEV_WAL));
483+ logger->set (l_bluefs_wal_total_bytes, _get_block_device_size (BDEV_WAL));
484484 logger->set (l_bluefs_wal_used_bytes, _get_used (BDEV_WAL));
485485 }
486486 if (alloc[BDEV_DB]) {
487- logger->set (l_bluefs_db_total_bytes, _get_total (BDEV_DB));
487+ logger->set (l_bluefs_db_total_bytes, _get_block_device_size (BDEV_DB));
488488 logger->set (l_bluefs_db_used_bytes, _get_used (BDEV_DB));
489489 }
490490 if (alloc[BDEV_SLOW]) {
491- logger->set (l_bluefs_slow_total_bytes, _get_total (BDEV_SLOW));
491+ logger->set (l_bluefs_slow_total_bytes, _get_block_device_size (BDEV_SLOW));
492492 logger->set (l_bluefs_slow_used_bytes, _get_used (BDEV_SLOW));
493493 }
494494}
@@ -587,7 +587,7 @@ uint64_t BlueFS::_get_used(unsigned id) const
587587 if (is_shared_alloc (id)) {
588588 used = shared_alloc->bluefs_used ;
589589 } else {
590- used = _get_total (id) - alloc[id]->get_free ();
590+ used = _get_block_device_size (id) - alloc[id]->get_free ();
591591 }
592592 return used;
593593}
@@ -599,15 +599,15 @@ uint64_t BlueFS::get_used(unsigned id)
599599 return _get_used (id);
600600}
601601
602- uint64_t BlueFS::_get_total (unsigned id) const
602+ uint64_t BlueFS::_get_block_device_size (unsigned id) const
603603{
604604 ceph_assert (id < bdev.size ());
605605 return bdev[id] ? bdev[id]->get_size () : 0 ;
606606}
607607
608- uint64_t BlueFS::get_total (unsigned id)
608+ uint64_t BlueFS::get_block_device_size (unsigned id)
609609{
610- return _get_total (id);
610+ return _get_block_device_size (id);
611611}
612612
613613uint64_t BlueFS::get_free (unsigned id)
@@ -658,7 +658,7 @@ void BlueFS::dump_block_extents(ostream& out)
658658 if (!bdev[i] || !alloc[i]) {
659659 continue ;
660660 }
661- auto total = get_total (i);
661+ auto total = get_block_device_size (i);
662662 auto free = get_free (i);
663663
664664 out << i << " : device size 0x" << std::hex << total
@@ -695,9 +695,9 @@ int BlueFS::mkfs(uuid_d osd_uuid, const bluefs_layout_t& layout)
695695 if (vselector == nullptr ) {
696696 vselector.reset (
697697 new OriginalVolumeSelector (
698- _get_total (BlueFS::BDEV_WAL) * 95 / 100 ,
699- _get_total (BlueFS::BDEV_DB) * 95 / 100 ,
700- _get_total (BlueFS::BDEV_SLOW) * 95 / 100 ));
698+ _get_block_device_size (BlueFS::BDEV_WAL) * 95 / 100 ,
699+ _get_block_device_size (BlueFS::BDEV_DB) * 95 / 100 ,
700+ _get_block_device_size (BlueFS::BDEV_SLOW) * 95 / 100 ));
701701 }
702702
703703 _init_logger ();
@@ -816,7 +816,7 @@ void BlueFS::_init_alloc()
816816 // isn't aligned with recommended alloc unit.
817817 // Final decision whether locked tail to be maintained is made after
818818 // BlueFS replay depending on existing allocations.
819- uint64_t size0 = _get_total (id);
819+ uint64_t size0 = _get_block_device_size (id);
820820 uint64_t size = size0 - reserved;
821821 size = p2align (size, alloc_size[id]) + reserved;
822822 if (size < size0) {
@@ -839,7 +839,7 @@ void BlueFS::_init_alloc()
839839 bdev[id]->get_size (),
840840 bdev[id]->get_block_size (),
841841 name);
842- uint64_t free_len = locked_offs ? locked_offs : _get_total (id) - reserved;
842+ uint64_t free_len = locked_offs ? locked_offs : _get_block_device_size (id) - reserved;
843843 alloc[id]->init_add_free (reserved, free_len);
844844 }
845845 }
@@ -1050,9 +1050,9 @@ int BlueFS::mount()
10501050 if (vselector == nullptr ) {
10511051 vselector.reset (
10521052 new OriginalVolumeSelector (
1053- _get_total (BlueFS::BDEV_WAL) * 95 / 100 ,
1054- _get_total (BlueFS::BDEV_DB) * 95 / 100 ,
1055- _get_total (BlueFS::BDEV_SLOW) * 95 / 100 ));
1053+ _get_block_device_size (BlueFS::BDEV_WAL) * 95 / 100 ,
1054+ _get_block_device_size (BlueFS::BDEV_DB) * 95 / 100 ,
1055+ _get_block_device_size (BlueFS::BDEV_SLOW) * 95 / 100 ));
10561056 }
10571057
10581058 _init_alloc ();
0 commit comments