]> granicus.if.org Git - zfs/commitdiff
Use ZFS_DEV macro instead of literals
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Wed, 19 Jun 2019 19:27:31 +0000 (04:27 +0900)
committerTony Hutter <hutter2@llnl.gov>
Wed, 25 Sep 2019 18:27:48 +0000 (11:27 -0700)
The rest of the code/comments use ZFS_DEV, so sync with that.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8912

lib/libzfs_core/libzfs_core.c
lib/libzpool/util.c

index 99fc84d0461453ad69e25006254bff5f72a49f6d..eb332bc94e8ce91c78d2ff8e5d53a21c9949a009 100644 (file)
@@ -52,7 +52,7 @@
  *
  *  - Thin Layer.  libzfs_core is a thin layer, marshaling arguments
  *  to/from the kernel ioctls.  There is generally a 1:1 correspondence
- *  between libzfs_core functions and ioctls to /dev/zfs.
+ *  between libzfs_core functions and ioctls to ZFS_DEV.
  *
  *  - Clear Atomicity.  Because libzfs_core functions are generally 1:1
  *  with kernel ioctls, and kernel ioctls are general atomic, each
@@ -135,7 +135,7 @@ libzfs_core_init(void)
 {
        (void) pthread_mutex_lock(&g_lock);
        if (g_refcount == 0) {
-               g_fd = open("/dev/zfs", O_RDWR);
+               g_fd = open(ZFS_DEV, O_RDWR);
                if (g_fd < 0) {
                        (void) pthread_mutex_unlock(&g_lock);
                        return (errno);
@@ -499,7 +499,7 @@ lzc_sync(const char *pool_name, nvlist_t *innvl, nvlist_t **outnvl)
  * The snapshots must all be in the same pool.
  * The value is the name of the hold (string type).
  *
- * If cleanup_fd is not -1, it must be the result of open("/dev/zfs", O_EXCL).
+ * If cleanup_fd is not -1, it must be the result of open(ZFS_DEV, O_EXCL).
  * In this case, when the cleanup_fd is closed (including on process
  * termination), the holds will be released.  If the system is shut down
  * uncleanly, the holds will be released when the pool is next opened
index ad05d2239ae04ab9f9a752739014bbb87010c575..67bc209ceec90c0d83306061089650862c989e26 100644 (file)
@@ -223,7 +223,7 @@ pool_active(void *unused, const char *name, uint64_t guid,
         * Use ZFS_IOC_POOL_SYNC to confirm if a pool is active
         */
 
-       fd = open("/dev/zfs", O_RDWR);
+       fd = open(ZFS_DEV, O_RDWR);
        if (fd < 0)
                return (-1);