From 19fbb9ddcd01790d49dbe1cbd5fdd817c457a6c3 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 18 Apr 2018 14:46:07 -0500 Subject: [PATCH] xfs: clean up xfs_mount allocation and dynamic initializers Source kernel commit: 72c44e35f02a1cb4032e476c398a7234badcf49f Most of the generic data structures embedded in xfs_mount are dynamically initialized immediately after mp is allocated. A few fields are left out and initialized during the xfs_mountfs() sequence, after mp has been attached to the superblock. To clean this up and help prevent premature access of associated fields, refactor xfs_mount allocation and all dependent init calls into a new helper. This self-documents that all low level data structures (i.e., locks, trees, etc.) should be initialized before xfs_mount is attached to the superblock. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- libxfs/xfs_sb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index e8dd4632c..24c981bef 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -713,7 +713,6 @@ xfs_sb_mount_common( struct xfs_sb *sbp) { mp->m_agfrotor = mp->m_agirotor = 0; - spin_lock_init(&mp->m_agirotor_lock); mp->m_maxagi = mp->m_sb.sb_agcount; mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG; mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT; -- 2.47.2