Simplify hostid logic

There is plenty of compatibility code for a hw_hostid
that isn't used by anything. At the same time, there are apparently
issues with the current hostid logic. coredumb in #zfsonlinux on
freenode reported that Fedora 17 changes its hostid on every boot, which
required force importing his pool. A suggestion by wca was to adopt
FreeBSD's behavior, where it treats hostid as zero if /etc/hostid does
not exist

Adopting FreeBSD's behavior permits us to eliminate plenty of code,
including a userland helper that invokes the system's hostid as a
fallback.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #224
This commit is contained in:
Richard Yao
2013-03-11 21:16:36 -04:00
committed by Brian Behlendorf
parent 3ceb71e896
commit acf0ade362
4 changed files with 6 additions and 64 deletions
-1
View File
@@ -143,7 +143,6 @@
/* Missing globals */
extern char spl_version[32];
extern unsigned long spl_hostid;
extern char hw_serial[11];
/* Missing misc functions */
extern int highbit(unsigned long i);
-1
View File
@@ -25,7 +25,6 @@
#ifndef _SPL_SYSTEMINFO_H
#define _SPL_SYSTEMINFO_H
#define HW_INVALID_HOSTID 0xFFFFFFFF /* an invalid hostid */
#define HW_HOSTID_LEN 11 /* minimum buffer size needed */
/* to hold a decimal or hex */
/* hostid string */