From dce29976d14ca5aeba2dc8f0c464931c3826a6de Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Tue, 19 Feb 2019 17:22:41 -0500 Subject: [PATCH] LU-11394 utils: Adjust HOSTID constant Use constant defined in spl / post-0.8.0 libspl, for HOSTID file. Also allows get_system_hostid() to be pulled in from ZFS 0.8.x Test-Parameters: trivial Signed-off-by: Nathaniel Clark Change-Id: Iba70d4f3b7f237260bdc964b28b601deeee81208 Reviewed-on: https://review.whamcloud.com/34278 Reviewed-by: Alex Zhuravlev Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Olaf Faaland-LLNL Reviewed-by: Oleg Drokin --- lustre/utils/libmount_utils_zfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lustre/utils/libmount_utils_zfs.c b/lustre/utils/libmount_utils_zfs.c index ebbee5c..770a053 100644 --- a/lustre/utils/libmount_utils_zfs.c +++ b/lustre/utils/libmount_utils_zfs.c @@ -31,8 +31,7 @@ #include #include #include - -#define HOSTID_PATH "/etc/hostid" +#include /* Persistent mount data is stored in these user attributes */ #define LDD_PREFIX "lustre:" @@ -273,7 +272,7 @@ static int zfs_check_hostid(struct mkfs_opts *mop) if (hostid != 0) return 0; - f = fopen(HOSTID_PATH, "r"); + f = fopen(HW_HOSTID_PATH, "r"); if (f == NULL) goto out; @@ -281,7 +280,7 @@ static int zfs_check_hostid(struct mkfs_opts *mop) fclose(f); if (rc != 1) { - fprintf(stderr, "Failed to read "HOSTID_PATH": %d\n", + fprintf(stderr, "Failed to read "HW_HOSTID_PATH": %d\n", rc); hostid = 0; } -- 1.8.3.1