From: Nathaniel Clark Date: Tue, 19 Feb 2019 22:22:41 +0000 (-0500) Subject: LU-11394 utils: Adjust HOSTID constant X-Git-Tag: 2.12.53~43 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F34278%2F3;p=fs%2Flustre-release.git 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 --- 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; }