libzfs: constify zfs_strip_partition(), zfs_strip_path()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13413
This commit is contained in:
наб
2022-05-03 19:56:12 +02:00
committed by Brian Behlendorf
parent ca3b105cd9
commit 5ac80603bd
5 changed files with 17 additions and 14 deletions
+4 -4
View File
@@ -81,7 +81,7 @@ zfs_append_partition(char *path, size_t max_len)
* caller must free the returned string
*/
char *
zfs_strip_partition(char *path)
zfs_strip_partition(const char *path)
{
char *tmp = strdup(path);
char *part = NULL, *d = NULL;
@@ -117,7 +117,7 @@ zfs_strip_partition(char *path)
* Returned string must be freed.
*/
static char *
zfs_strip_partition_path(char *path)
zfs_strip_partition_path(const char *path)
{
char *newpath = strdup(path);
char *sd_offset;
@@ -148,8 +148,8 @@ zfs_strip_partition_path(char *path)
/*
* Strip the unwanted portion of a device path.
*/
char *
zfs_strip_path(char *path)
const char *
zfs_strip_path(const char *path)
{
return (strrchr(path, '/') + 1);
}