From 6bb0c4b93ccb3777600f9309aa7fdb634d605b02 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sun, 4 Jan 2009 12:00:48 -0800 Subject: [PATCH] --- yaml --- r: 125731 b: refs/heads/master c: c644f0e4b56f9a2fc066cd0d75a18074d130e4a3 h: refs/heads/master i: 125729: 4bbde472438227d898b9a5ed771c8059f7b75fce 125727: 9c2e49d07c59bb7b5dd4466aa94fbabacc6d54b0 v: v3 --- [refs] | 2 +- trunk/fs/ext4/ext4_sb.h | 6 ++++++ trunk/include/linux/blockgroup_lock.h | 7 +++++-- trunk/include/linux/ext2_fs_sb.h | 6 ++++++ trunk/include/linux/ext3_fs_sb.h | 6 ++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 8ecd4cc59e8b..f127f7eb70f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0a30c5cefa53cbac429dcb2de906c0637b646253 +refs/heads/master: c644f0e4b56f9a2fc066cd0d75a18074d130e4a3 diff --git a/trunk/fs/ext4/ext4_sb.h b/trunk/fs/ext4/ext4_sb.h index 445fde603df8..b21f16713db0 100644 --- a/trunk/fs/ext4/ext4_sb.h +++ b/trunk/fs/ext4/ext4_sb.h @@ -146,4 +146,10 @@ struct ext4_sb_info { struct flex_groups *s_flex_groups; }; +static inline spinlock_t * +sb_bgl_lock(struct ext4_sb_info *sbi, unsigned int block_group) +{ + return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); +} + #endif /* _EXT4_SB */ diff --git a/trunk/include/linux/blockgroup_lock.h b/trunk/include/linux/blockgroup_lock.h index 8607312983bd..e44b88ba552b 100644 --- a/trunk/include/linux/blockgroup_lock.h +++ b/trunk/include/linux/blockgroup_lock.h @@ -53,7 +53,10 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl) * The accessor is a macro so we can embed a blockgroup_lock into different * superblock types */ -#define sb_bgl_lock(sb, block_group) \ - (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock) +static inline spinlock_t * +bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group) +{ + return &bgl->locks[(block_group) & (NR_BG_LOCKS-1)].lock; +} #endif diff --git a/trunk/include/linux/ext2_fs_sb.h b/trunk/include/linux/ext2_fs_sb.h index f273415ab6f1..dc541f3653d1 100644 --- a/trunk/include/linux/ext2_fs_sb.h +++ b/trunk/include/linux/ext2_fs_sb.h @@ -108,4 +108,10 @@ struct ext2_sb_info { struct ext2_reserve_window_node s_rsv_window_head; }; +static inline spinlock_t * +sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) +{ + return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); +} + #endif /* _LINUX_EXT2_FS_SB */ diff --git a/trunk/include/linux/ext3_fs_sb.h b/trunk/include/linux/ext3_fs_sb.h index b65f0288b842..e024e38248ff 100644 --- a/trunk/include/linux/ext3_fs_sb.h +++ b/trunk/include/linux/ext3_fs_sb.h @@ -83,4 +83,10 @@ struct ext3_sb_info { #endif }; +static inline spinlock_t * +sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) +{ + return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); +} + #endif /* _LINUX_EXT3_FS_SB */