Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144941892
D39410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39410.diff
View Options
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -812,22 +812,12 @@
int
zfs_set_bootenv(void *vdev, nvlist_t *benv)
{
- struct zfs_devdesc *dev = (struct zfs_devdesc *)vdev;
spa_t *spa;
- vdev_t *vd;
- if (dev->dd.d_dev->dv_type != DEVT_ZFS)
- return (ENOTSUP);
-
- if ((spa = spa_find_by_dev(dev)) == NULL)
+ if ((spa = spa_find_by_dev((struct zfs_devdesc *)vdev)) == NULL)
return (ENXIO);
- STAILQ_FOREACH(vd, &spa->spa_root_vdev->v_children, v_childlink) {
- vdev_write_bootenv(vd, benv);
- }
-
- spa->spa_bootenv = benv;
- return (0);
+ return (zfs_set_bootenv_spa(spa, benv));
}
/*
diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c
--- a/stand/libsa/zfs/zfsimpl.c
+++ b/stand/libsa/zfs/zfsimpl.c
@@ -3883,3 +3883,19 @@
*benvp = benv;
return (0);
}
+
+/*
+ * Store nvlist to pool label bootenv area. Also updates cached pointer in spa.
+ */
+static int
+zfs_set_bootenv_spa(spa_t *spa, nvlist_t *benv)
+{
+ vdev_t *vd;
+
+ STAILQ_FOREACH(vd, &spa->spa_root_vdev->v_children, v_childlink) {
+ vdev_write_bootenv(vd, benv);
+ }
+
+ spa->spa_bootenv = benv;
+ return (0);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 8:24 AM (7 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28733550
Default Alt Text
D39410.diff (1 KB)
Attached To
Mode
D39410: stand/zfs: Refactor zfs_set_bootenv
Attached
Detach File
Event Timeline
Log In to Comment