summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2019-11-04 22:58:42 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-05 17:28:25 +0100
commita943f372c22bd4923c4897ff4e7d3f03db0d6716 (patch)
tree06f7111e0a78c3e23a7da612710a49651c3c022b /fs/xfs/xfs_super.c
parentxfs: use kmem functions for struct xfs_mount (diff)
downloadlinux-a943f372c22bd4923c4897ff4e7d3f03db0d6716.tar.xz
linux-a943f372c22bd4923c4897ff4e7d3f03db0d6716.zip
xfs: merge freeing of mp names and mp
In all cases when struct xfs_mount (mp) fields m_rtname and m_logname are freed mp is also freed, so merge these into a single function xfs_mount_free() Signed-off-by: Ian Kent <raven@themaw.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index eb919e74d8eb..6d908b76aa9e 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -998,12 +998,13 @@ xfs_fs_drop_inode(
return generic_drop_inode(inode) || (ip->i_flags & XFS_IDONTCACHE);
}
-STATIC void
-xfs_free_names(
+static void
+xfs_mount_free(
struct xfs_mount *mp)
{
kfree(mp->m_rtname);
kfree(mp->m_logname);
+ kmem_free(mp);
}
STATIC int
@@ -1178,8 +1179,7 @@ xfs_test_remount_options(
tmp_mp->m_super = sb;
error = xfs_parseargs(tmp_mp, options);
- xfs_free_names(tmp_mp);
- kmem_free(tmp_mp);
+ xfs_mount_free(tmp_mp);
return error;
}
@@ -1710,8 +1710,7 @@ xfs_fs_fill_super(
xfs_close_devices(mp);
out_free_names:
sb->s_fs_info = NULL;
- xfs_free_names(mp);
- kmem_free(mp);
+ xfs_mount_free(mp);
out:
return error;
@@ -1742,8 +1741,7 @@ xfs_fs_put_super(
xfs_close_devices(mp);
sb->s_fs_info = NULL;
- xfs_free_names(mp);
- kmem_free(mp);
+ xfs_mount_free(mp);
}
STATIC struct dentry *