Skip to content

Commit

Permalink
libdm: Export ExtractBlockDeviceName()
Browse files Browse the repository at this point in the history
Make this function available to libdm users. A caller outside libdm will
be added by a later patch.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Merged-In: I3e3560f3cdef8978eac644d5b53cf3851209c0c2
Change-Id: Ic05cc84565952662178bb649ec97cad6f76dcf92
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <[email protected]>
(cherry picked from commit 9e54a90)
Signed-off-by: Pranav Vashi <[email protected]>
  • Loading branch information
Bart Van Assche authored and neobuddy89 committed Apr 6, 2022
1 parent 0635407 commit 083da82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs_mgr/libdm/dm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ std::string DeviceMapper::GetTargetType(const struct dm_target_spec& spec) {
return std::string{spec.target_type, sizeof(spec.target_type)};
}

static std::optional<std::string> ExtractBlockDeviceName(const std::string& path) {
std::optional<std::string> ExtractBlockDeviceName(const std::string& path) {
static constexpr std::string_view kDevBlockPrefix("/dev/block/");
if (android::base::StartsWith(path, kDevBlockPrefix)) {
return path.substr(kDevBlockPrefix.length());
Expand Down

0 comments on commit 083da82

Please sign in to comment.