From ba0a56bb2ac7afd2d1d7086a9e1457b798cef978 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 9 Mar 2010 13:49:36 -0800 Subject: [PATCH] Fix struct ht_lock padding in arc.c. This was leading to a compilation error because in Linux, sizeof (kmutex_t) can be larger than 64 in some circumstances (e.g. with debugging and lockdep enabled). The code was previously fixed to align the structure to 256 bytes, but a better fix is to align it to the next multiple of 64 bytes. --- module/zfs/arc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index a3791d4ed0..602efd6a90 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -517,12 +517,13 @@ static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes); * Hash table routines */ -#define HT_LOCK_PAD 256 +#define HT_LOCK_ALIGN 64 +#define HT_LOCK_PAD (P2NPHASE(sizeof (kmutex_t), (HT_LOCK_ALIGN))) struct ht_lock { kmutex_t ht_lock; #ifdef _KERNEL - unsigned char pad[(HT_LOCK_PAD - sizeof (kmutex_t))]; + unsigned char pad[HT_LOCK_PAD]; #endif };