Skip to contentSkip to conversation

common/rc: drop SGI DMF specific _mount_ops_filter

PATCH In review David Disseldorp 2 participants 2 messages Jan 10, 2023 – Jan 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc: drop SGI DMF specific _mount_ops_filter

The _mount() helper function is the only caller of _mount_ops_filter(), which appears to have been used in the past to replace the SGI DMF specific mtpt= mount option setting.

_mount() invocations could now be replaced with $MOUNT_PROG calls directly, but I've retained the helper function for readability.

---
 common/rc | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
common/rc +1 -14
index 23530413..81ce1026 100644
@@ -120,7 +120,7 @@ _get_hugepagesize()
 
 _mount()
 {
-    $MOUNT_PROG `_mount_ops_filter $*`
+    $MOUNT_PROG $*
 }
 
 # Call _mount to do mount operation but also save mountpoint to
@@ -211,19 +211,6 @@ _test_options()
 	TEST_OPTIONS="$TEST_OPTIONS ${log_opt}logdev=$TEST_LOGDEV"
 }
 
-_mount_ops_filter()
-{
-    local params="$*"
-    local last_index=$(( $# - 1 ))
-
-    [ $last_index -gt 0 ] && shift $last_index
-    local fs_escaped=$1
-
-    echo $params | \
-        $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$fs_escaped\1\2#; print;"
-
-}
-
 # Used for mounting non-scratch devices (e.g. loop, dm constructs)
 # with the safe set of scratch mount options (e.g. loop image may be
 # hosted on $SCRATCH_DEV, so can't use external scratch devices).
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · David Disseldorp

The _mount() helper function is the only caller of _mount_ops_filter(), which appears to have been used in the past to replace the SGI DMF specific mtpt= mount option setting.

_mount() invocations could now be replaced with $MOUNT_PROG calls directly, but I've retained the helper function for readability.

---

This makes sense to me. Likes we've removed dmapi things, this "-o mtpt" support can be removed too.

The _mount_ops_filter() might can be brought back if we need a filter for _mount() in one day, I think that's another story. Now let's remove it if it's useless.

Quoted 39 lines
 common/rc | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
common/rc +1 -14
index 23530413..81ce1026 100644
@@ -120,7 +120,7 @@ _get_hugepagesize()
 
 _mount()
 {
-    $MOUNT_PROG `_mount_ops_filter $*`
+    $MOUNT_PROG $*
 }
 
 # Call _mount to do mount operation but also save mountpoint to
@@ -211,19 +211,6 @@ _test_options()
 	TEST_OPTIONS="$TEST_OPTIONS ${log_opt}logdev=$TEST_LOGDEV"
 }
 
-_mount_ops_filter()
-{
-    local params="$*"
-    local last_index=$(( $# - 1 ))
-
-    [ $last_index -gt 0 ] && shift $last_index
-    local fs_escaped=$1
-
-    echo $params | \
-        $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$fs_escaped\1\2#; print;"
-
-}
-
 # Used for mounting non-scratch devices (e.g. loop, dm constructs)
 # with the safe set of scratch mount options (e.g. loop image may be
 # hosted on $SCRATCH_DEV, so can't use external scratch devices).
Signature · 1 line
2.35.3