Loading fs_mgr/fs_mgr_dm_linear.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,11 @@ bool CreateLogicalPartition(const std::string& block_device, uint32_t metadata_s bool DestroyLogicalPartition(const std::string& name) { DeviceMapper& dm = DeviceMapper::Instance(); return dm.DeleteDevice(name); if (!dm.DeleteDevice(name)) { return false; } LINFO << "Unmapped logical partition " << name; return true; } } // namespace fs_mgr Loading fs_mgr/liblp/builder.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -498,13 +498,18 @@ void MetadataBuilder::set_block_device_info(const BlockDeviceInfo& device_info) bool MetadataBuilder::ResizePartition(Partition* partition, uint64_t requested_size) { // Align the space needed up to the nearest sector. uint64_t aligned_size = AlignTo(requested_size, device_info_.logical_block_size); uint64_t old_size = partition->size(); if (aligned_size > partition->size()) { return GrowPartition(partition, aligned_size); if (aligned_size > old_size) { if (!GrowPartition(partition, aligned_size)) { return false; } if (aligned_size < partition->size()) { } else if (aligned_size < partition->size()) { ShrinkPartition(partition, aligned_size); } LINFO << "Partition " << partition->name() << " will resize from " << old_size << " bytes to " << aligned_size << " bytes"; return true; } Loading fs_mgr/liblp/utility.h +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include "liblp/metadata_format.h" #define LP_TAG "[liblp]" #define LWARN LOG(WARNING) << LP_TAG #define LINFO LOG(INFO) << LP_TAG #define LERROR LOG(ERROR) << LP_TAG #define PERROR PLOG(ERROR) << LP_TAG Loading fs_mgr/liblp/writer.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -304,7 +304,11 @@ bool FlashPartitionTable(const std::string& block_device, const LpMetadata& meta PERROR << __PRETTY_FUNCTION__ << "open failed: " << block_device; return false; } return FlashPartitionTable(fd, metadata, slot_number); if (!FlashPartitionTable(fd, metadata, slot_number)) { return false; } LWARN << "Flashed new logical partition geometry to " << block_device; return true; } bool UpdatePartitionTable(const std::string& block_device, const LpMetadata& metadata, Loading @@ -314,7 +318,12 @@ bool UpdatePartitionTable(const std::string& block_device, const LpMetadata& met PERROR << __PRETTY_FUNCTION__ << "open failed: " << block_device; return false; } return UpdatePartitionTable(fd, metadata, slot_number); if (!UpdatePartitionTable(fd, metadata, slot_number)) { return false; } LINFO << "Updated logical partition table at slot " << slot_number << " on device " << block_device; return true; } bool UpdatePartitionTable(int fd, const LpMetadata& metadata, uint32_t slot_number) { Loading Loading
fs_mgr/fs_mgr_dm_linear.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,11 @@ bool CreateLogicalPartition(const std::string& block_device, uint32_t metadata_s bool DestroyLogicalPartition(const std::string& name) { DeviceMapper& dm = DeviceMapper::Instance(); return dm.DeleteDevice(name); if (!dm.DeleteDevice(name)) { return false; } LINFO << "Unmapped logical partition " << name; return true; } } // namespace fs_mgr Loading
fs_mgr/liblp/builder.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -498,13 +498,18 @@ void MetadataBuilder::set_block_device_info(const BlockDeviceInfo& device_info) bool MetadataBuilder::ResizePartition(Partition* partition, uint64_t requested_size) { // Align the space needed up to the nearest sector. uint64_t aligned_size = AlignTo(requested_size, device_info_.logical_block_size); uint64_t old_size = partition->size(); if (aligned_size > partition->size()) { return GrowPartition(partition, aligned_size); if (aligned_size > old_size) { if (!GrowPartition(partition, aligned_size)) { return false; } if (aligned_size < partition->size()) { } else if (aligned_size < partition->size()) { ShrinkPartition(partition, aligned_size); } LINFO << "Partition " << partition->name() << " will resize from " << old_size << " bytes to " << aligned_size << " bytes"; return true; } Loading
fs_mgr/liblp/utility.h +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include "liblp/metadata_format.h" #define LP_TAG "[liblp]" #define LWARN LOG(WARNING) << LP_TAG #define LINFO LOG(INFO) << LP_TAG #define LERROR LOG(ERROR) << LP_TAG #define PERROR PLOG(ERROR) << LP_TAG Loading
fs_mgr/liblp/writer.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -304,7 +304,11 @@ bool FlashPartitionTable(const std::string& block_device, const LpMetadata& meta PERROR << __PRETTY_FUNCTION__ << "open failed: " << block_device; return false; } return FlashPartitionTable(fd, metadata, slot_number); if (!FlashPartitionTable(fd, metadata, slot_number)) { return false; } LWARN << "Flashed new logical partition geometry to " << block_device; return true; } bool UpdatePartitionTable(const std::string& block_device, const LpMetadata& metadata, Loading @@ -314,7 +318,12 @@ bool UpdatePartitionTable(const std::string& block_device, const LpMetadata& met PERROR << __PRETTY_FUNCTION__ << "open failed: " << block_device; return false; } return UpdatePartitionTable(fd, metadata, slot_number); if (!UpdatePartitionTable(fd, metadata, slot_number)) { return false; } LINFO << "Updated logical partition table at slot " << slot_number << " on device " << block_device; return true; } bool UpdatePartitionTable(int fd, const LpMetadata& metadata, uint32_t slot_number) { Loading