diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2015-04-16 12:46:31 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:03 -0400 |
commit | 0de6d6b9a2ba21ae28b2420f6684021904833f68 (patch) | |
tree | b8f0c9217fe2bf2b6fac941858d863661a4b766d /fs/nilfs2/mdt.h | |
parent | ead8ecffa3e180202c1096a39f14bbecffb139a1 (diff) | |
download | linux-stable-0de6d6b9a2ba21ae28b2420f6684021904833f68.tar.gz linux-stable-0de6d6b9a2ba21ae28b2420f6684021904833f68.tar.bz2 linux-stable-0de6d6b9a2ba21ae28b2420f6684021904833f68.zip |
nilfs2: use bgl_lock_ptr()
Simplify nilfs_mdt_bgl_lock() by utilizing bgl_lock_ptr() helper in
<linux/blockgroup_lock.h>.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/mdt.h')
-rw-r--r-- | fs/nilfs2/mdt.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nilfs2/mdt.h b/fs/nilfs2/mdt.h index ab172e8549c5..a294ea38e4c7 100644 --- a/fs/nilfs2/mdt.h +++ b/fs/nilfs2/mdt.h @@ -111,7 +111,10 @@ static inline __u64 nilfs_mdt_cno(struct inode *inode) return ((struct the_nilfs *)inode->i_sb->s_fs_info)->ns_cno; } -#define nilfs_mdt_bgl_lock(inode, bg) \ - (&NILFS_MDT(inode)->mi_bgl->locks[(bg) & (NR_BG_LOCKS-1)].lock) +static inline spinlock_t * +nilfs_mdt_bgl_lock(struct inode *inode, unsigned int block_group) +{ + return bgl_lock_ptr(NILFS_MDT(inode)->mi_bgl, block_group); +} #endif /* _NILFS_MDT_H */ |