| #ifndef _LINUX_BLOCKGROUP_LOCK_H |
| #define _LINUX_BLOCKGROUP_LOCK_H |
| * Per-blockgroup locking for ext2 and ext3. |
| * Simple hashed spinlocking. |
| #include <linux/spinlock.h> |
| * We want a power-of-two. Is there a better way than this? |
| } ____cacheline_aligned_in_smp; |
| struct bgl_lock locks[NR_BG_LOCKS]; |
| static inline void bgl_lock_init(struct blockgroup_lock *bgl) |
| for (i = 0; i < NR_BG_LOCKS; i++) |
| spin_lock_init(&bgl->locks[i].lock); |
| * The accessor is a macro so we can embed a blockgroup_lock into different |
| #define sb_bgl_lock(sb, block_group) \ |
| (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock) |