mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -5588,12 +5588,12 @@
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='zfs_strip_partition' mangled-name='zfs_strip_partition' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zfs_strip_partition'>
|
||||
<parameter type-id='26a90f95' name='path'/>
|
||||
<parameter type-id='80f4b756' name='path'/>
|
||||
<return type-id='26a90f95'/>
|
||||
</function-decl>
|
||||
<function-decl name='zfs_strip_path' mangled-name='zfs_strip_path' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zfs_strip_path'>
|
||||
<parameter type-id='26a90f95' name='path'/>
|
||||
<return type-id='26a90f95'/>
|
||||
<parameter type-id='80f4b756' name='path'/>
|
||||
<return type-id='80f4b756'/>
|
||||
</function-decl>
|
||||
<function-decl name='zfs_get_enclosure_sysfs_path' mangled-name='zfs_get_enclosure_sysfs_path' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zfs_get_enclosure_sysfs_path'>
|
||||
<parameter type-id='80f4b756' name='dev_name'/>
|
||||
|
||||
@@ -4123,7 +4123,8 @@ char *
|
||||
zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
|
||||
int name_flags)
|
||||
{
|
||||
char *path, *type;
|
||||
char *type, *tpath;
|
||||
const char *path;
|
||||
uint64_t value;
|
||||
char buf[PATH_BUF_LEN];
|
||||
char tmpbuf[PATH_BUF_LEN * 2];
|
||||
@@ -4148,7 +4149,9 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
|
||||
(void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &value);
|
||||
(void) snprintf(buf, sizeof (buf), "%llu", (u_longlong_t)value);
|
||||
path = buf;
|
||||
} else if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) {
|
||||
} else if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &tpath) == 0) {
|
||||
path = tpath;
|
||||
|
||||
if (name_flags & VDEV_NAME_FOLLOW_LINKS) {
|
||||
char *rp = realpath(path, NULL);
|
||||
if (rp) {
|
||||
|
||||
Reference in New Issue
Block a user