From 439a9766adbabcdfcce9fb0396b43c9e1482155a Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 1 May 2023 09:26:44 -0600 Subject: [PATCH] stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c zfsimpl.c doesn't know about devdesc at all, but zfs.c does. Move it to zfs.c, which is the only user. Keep it static for now, but it could be exposed later if something else were to need it. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D39408 --- stand/libsa/zfs/zfs.c | 13 +++++++++++++ stand/libsa/zfs/zfsimpl.c | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c index 3d5a392dd03..4a4d3cf2684 100644 --- a/stand/libsa/zfs/zfs.c +++ b/stand/libsa/zfs/zfs.c @@ -373,6 +373,19 @@ zfs_readdir(struct open_file *f, struct dirent *d) } } +static spa_t * +spa_find_by_dev(struct zfs_devdesc *dev) +{ + + if (dev->dd.d_dev->dv_type != DEVT_ZFS) + return (NULL); + + if (dev->pool_guid == 0) + return (STAILQ_FIRST(&zfs_pools)); + + return (spa_find_by_guid(dev->pool_guid)); +} + /* * if path is NULL, create mount structure, but do not add it to list. */ diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 4a285470642..29e8bb82b6e 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -1367,19 +1367,6 @@ spa_find_by_name(const char *name) return (NULL); } -static spa_t * -spa_find_by_dev(struct zfs_devdesc *dev) -{ - - if (dev->dd.d_dev->dv_type != DEVT_ZFS) - return (NULL); - - if (dev->pool_guid == 0) - return (STAILQ_FIRST(&zfs_pools)); - - return (spa_find_by_guid(dev->pool_guid)); -} - static spa_t * spa_create(uint64_t guid, const char *name) {