git: 439a9766adba - main - stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 01 May 2023 21:04:12 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=439a9766adbabcdfcce9fb0396b43c9e1482155a

commit 439a9766adbabcdfcce9fb0396b43c9e1482155a
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-05-01 15:26:44 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-05-01 21:02:52 +0000

    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 3d5a392dd03f..4a4d3cf26843 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 4a285470642e..29e8bb82b6e2 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)
 {