Windows driver writes relative volume IDs to metadata field.  Use that value
as a hint for raid/rX device number to make it persistent across reboots.
Add missing dialog(1) arguments to internationalize "Help"-button label.
Add new f_yesno/f_noyes wrapper functions (which take printf(1) syntax).
Rename vfs_hash_index() to vfs_hash_bucket().

Reviewed by:	peter
Tested by:	peter, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
Add exported vfs_hash_index() function, which calculates the canonical
pre-masked hash for the given vnode.  The function assumes that
vp->v_hash is initialized by the filesystem vnode instantiation
function.  At the moment, it is only done if filesystem uses
vfs_hash_insert().

Reviewed by:	peter
Tested by:	peter, pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7c243b6..0bdaf36 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW,
 #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt)
 #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt)

+static int vnsz2log;

 /*
  * Initialize the vnode management data structures.
@@ -293,6 +294,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW,
 static void
 vntblinit(void *dummy __unused)
 {
+	u_int i;
 	int physvnodes, virtvnodes;

 	/*
@@ -332,6 +334,9 @@ vntblinit(void *dummy __unused)
 	syncer_maxdelay = syncer_mask + 1;
 	mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF);
 	cv_init(&sync_wakeup, "syncer");
+	for (i = 1; i <= sizeof(struct vnode); i <<= 1)
+		vnsz2log++;
+	vnsz2log--;
 }
 SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL);

@@ -1067,6 +1072,14 @@ alloc:
 	}
 	rangelock_init(&vp->v_rl);

+	/*
+	 * For the filesystems which do not use vfs_hash_insert(),
+	 * still initialize v_hash to have vfs_hash_index() useful.
+	 * E.g., nullfs uses vfs_hash_index() on the lower vnode for
+	 * its own hashing.
+	 */
+	vp->v_hash = (uintptr_t)vp >> vnsz2log;
+
 	*vpp = vp;
 	return (0);
 }
The current default size of the nullfs hash table used to lookup the
existing nullfs vnode by the lower vnode is only 16 slots.  Since the
default mode for the nullfs is to cache the vnodes, hash has extremely
huge chains.

Size the nullfs hashtbl based on the current value of
desiredvnodes. Use vfs_hash_index() to calculate the hash bucket for a
given vnode.

Pointy hat to:	    kib
Diagnosed and reviewed by:	peter
Tested by:    peter, pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
For zfs vnodes, use the standard inode number based hash algorithm.

Reviewed and tested by:	peter
Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
Rearrange the struct bufobj and struct vnode layouts to reduce
padding.  On the amd64 kernel with INVARIANTS turned off, size of the
struct vnode is reduced from 496 to 472 bytes, saving 24 bytes of
memory and KVA per vnode.

Noted and reviewed by:	peter
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Add a trivial comment to record the proper commit log for r245407:

Set the v_hash for a new vnode in the getnewvnode() to the value
calculated based on the vnode structure address.  Filesystems using
vfs_hash_insert() override the v_hash using the standard formula of
(inode_number + mnt_hashseed).  For other filesystems, the
initialization allows the vfs_hash_index() to provide useful hash too.

Suggested, reviewed and tested by:	peter
Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
Directly uses calloc(3) instread of malloc(3) + memset(3)

Reported by:	Jeremy Chadwick <jdc@koitsu.org>
MFC after:	3 days
Switch the default CPU to an arm9. This removes compiler support for the
unsupported 26-bit addressing mode. This change is required for moving to
the ARM EABI.
Update sigcode to use both the current ABI and FreeBSD's version of the
ARM EABI syscall calling convention.

The current ABI encodes the syscall number in the instruction. This causes
issues with the thumb mode as it only has 8 bits to encode this value and
we have too many system calls and by using a register will simplify the
code to get the syscall number in the kernel.

With the ARM EABI we reuse the Linux calling convention by storing the
value in r7. Because of this we use both methods to encode the syscall
number in this function.
Allow commands without any additional arguments, as stated in the
manpage.  While here, exit early when there is nothing to do.

PR:            168415
Submitted by:  Zhihao Yuan (initial version)
MFC after:     1 week
Approved by:   kib (mentor)
Remove stray tabs.

Submitted by:	kib
Approved by:	kib (mentor)
MFC after:	1 week
- Get rid of unused function vmspace_wired_count().

Reviewed by:	alc
Approved by:	kib (mentor)
MFC after:	1 week
sh: Pass $? to command substitution containing compound/multiple commands.

Example:
  false; echo $(echo $?; :)
Print some more metadata fields.
Quiesce some clang warnings while we're here doing stuff.

Submitted by:	Hiren Panchasara <hiren.panchasara@gmail.com>
Obtained from:	Yahoo! Inc
Small cosmetic tuning of the IRRT status constants.