From: Ryusuke Konishi Date: Thu, 16 Apr 2015 19:46:31 +0000 (-0700) Subject: nilfs2: use bgl_lock_ptr() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0de6d6b9a2ba21ae28b2420f6684021904833f68;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git nilfs2: use bgl_lock_ptr() Simplify nilfs_mdt_bgl_lock() by utilizing bgl_lock_ptr() helper in . Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 */