Loading fs_mgr/liblp/builder.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ bool ZeroExtent::AddTo(LpMetadata* out) const { return true; } Partition::Partition(const std::string& name, const std::string& group_name, uint32_t attributes) Partition::Partition(std::string_view name, std::string_view group_name, uint32_t attributes) : name_(name), group_name_(group_name), attributes_(attributes), size_(0) {} void Partition::AddExtent(std::unique_ptr<Extent>&& extent) { Loading Loading @@ -436,10 +436,10 @@ bool MetadataBuilder::AddGroup(const std::string& group_name, uint64_t maximum_s } Partition* MetadataBuilder::AddPartition(const std::string& name, uint32_t attributes) { return AddPartition(name, std::string(kDefaultGroup), attributes); return AddPartition(name, kDefaultGroup, attributes); } Partition* MetadataBuilder::AddPartition(const std::string& name, const std::string& group_name, Partition* MetadataBuilder::AddPartition(std::string_view name, std::string_view group_name, uint32_t attributes) { if (name.empty()) { LERROR << "Partition must have a non-empty name."; Loading @@ -457,7 +457,7 @@ Partition* MetadataBuilder::AddPartition(const std::string& name, const std::str return partitions_.back().get(); } Partition* MetadataBuilder::FindPartition(const std::string& name) { Partition* MetadataBuilder::FindPartition(std::string_view name) { for (const auto& partition : partitions_) { if (partition->name() == name) { return partition.get(); Loading Loading @@ -958,7 +958,7 @@ std::vector<std::string> MetadataBuilder::ListGroups() const { return names; } void MetadataBuilder::RemoveGroupAndPartitions(const std::string& group_name) { void MetadataBuilder::RemoveGroupAndPartitions(std::string_view group_name) { if (group_name == kDefaultGroup) { // Cannot remove the default group. return; Loading fs_mgr/liblp/include/liblp/builder.h +4 −4 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ class Partition final { friend class MetadataBuilder; public: Partition(const std::string& name, const std::string& group_name, uint32_t attributes); Partition(std::string_view name, std::string_view group_name, uint32_t attributes); // Add a raw extent. void AddExtent(std::unique_ptr<Extent>&& extent); Loading Loading @@ -214,7 +214,7 @@ class MetadataBuilder { // Add a partition, returning a handle so it can be sized as needed. If a // partition with the given name already exists, nullptr is returned. Partition* AddPartition(const std::string& name, const std::string& group_name, Partition* AddPartition(std::string_view name, std::string_view group_name, uint32_t attributes); // Same as AddPartition above, but uses the default partition group which Loading @@ -225,7 +225,7 @@ class MetadataBuilder { void RemovePartition(const std::string& name); // Find a partition by name. If no partition is found, nullptr is returned. Partition* FindPartition(const std::string& name); Partition* FindPartition(std::string_view name); // Find a group by name. If no group is found, nullptr is returned. PartitionGroup* FindGroup(std::string_view name); Loading Loading @@ -269,7 +269,7 @@ class MetadataBuilder { std::vector<std::string> ListGroups() const; // Remove all partitions belonging to a group, then remove the group. void RemoveGroupAndPartitions(const std::string& group_name); void RemoveGroupAndPartitions(std::string_view group_name); // Set the LP_METADATA_AUTO_SLOT_SUFFIXING flag. void SetAutoSlotSuffixing(); Loading Loading
fs_mgr/liblp/builder.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ bool ZeroExtent::AddTo(LpMetadata* out) const { return true; } Partition::Partition(const std::string& name, const std::string& group_name, uint32_t attributes) Partition::Partition(std::string_view name, std::string_view group_name, uint32_t attributes) : name_(name), group_name_(group_name), attributes_(attributes), size_(0) {} void Partition::AddExtent(std::unique_ptr<Extent>&& extent) { Loading Loading @@ -436,10 +436,10 @@ bool MetadataBuilder::AddGroup(const std::string& group_name, uint64_t maximum_s } Partition* MetadataBuilder::AddPartition(const std::string& name, uint32_t attributes) { return AddPartition(name, std::string(kDefaultGroup), attributes); return AddPartition(name, kDefaultGroup, attributes); } Partition* MetadataBuilder::AddPartition(const std::string& name, const std::string& group_name, Partition* MetadataBuilder::AddPartition(std::string_view name, std::string_view group_name, uint32_t attributes) { if (name.empty()) { LERROR << "Partition must have a non-empty name."; Loading @@ -457,7 +457,7 @@ Partition* MetadataBuilder::AddPartition(const std::string& name, const std::str return partitions_.back().get(); } Partition* MetadataBuilder::FindPartition(const std::string& name) { Partition* MetadataBuilder::FindPartition(std::string_view name) { for (const auto& partition : partitions_) { if (partition->name() == name) { return partition.get(); Loading Loading @@ -958,7 +958,7 @@ std::vector<std::string> MetadataBuilder::ListGroups() const { return names; } void MetadataBuilder::RemoveGroupAndPartitions(const std::string& group_name) { void MetadataBuilder::RemoveGroupAndPartitions(std::string_view group_name) { if (group_name == kDefaultGroup) { // Cannot remove the default group. return; Loading
fs_mgr/liblp/include/liblp/builder.h +4 −4 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ class Partition final { friend class MetadataBuilder; public: Partition(const std::string& name, const std::string& group_name, uint32_t attributes); Partition(std::string_view name, std::string_view group_name, uint32_t attributes); // Add a raw extent. void AddExtent(std::unique_ptr<Extent>&& extent); Loading Loading @@ -214,7 +214,7 @@ class MetadataBuilder { // Add a partition, returning a handle so it can be sized as needed. If a // partition with the given name already exists, nullptr is returned. Partition* AddPartition(const std::string& name, const std::string& group_name, Partition* AddPartition(std::string_view name, std::string_view group_name, uint32_t attributes); // Same as AddPartition above, but uses the default partition group which Loading @@ -225,7 +225,7 @@ class MetadataBuilder { void RemovePartition(const std::string& name); // Find a partition by name. If no partition is found, nullptr is returned. Partition* FindPartition(const std::string& name); Partition* FindPartition(std::string_view name); // Find a group by name. If no group is found, nullptr is returned. PartitionGroup* FindGroup(std::string_view name); Loading Loading @@ -269,7 +269,7 @@ class MetadataBuilder { std::vector<std::string> ListGroups() const; // Remove all partitions belonging to a group, then remove the group. void RemoveGroupAndPartitions(const std::string& group_name); void RemoveGroupAndPartitions(std::string_view group_name); // Set the LP_METADATA_AUTO_SLOT_SUFFIXING flag. void SetAutoSlotSuffixing(); Loading