Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ZFS_DEV macro instead of literals #8912

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/libzfs_core/libzfs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/libzpool/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down