From patchwork Mon Nov 4 10:55:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11225403 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35EBA1709 for ; Mon, 4 Nov 2019 10:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1380421D7D for ; Mon, 4 Nov 2019 10:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbfKDKzE (ORCPT ); Mon, 4 Nov 2019 05:55:04 -0500 Received: from icp-osb-irony-out4.external.iinet.net.au ([203.59.1.220]:34019 "EHLO icp-osb-irony-out4.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728520AbfKDKzE (ORCPT ); Mon, 4 Nov 2019 05:55:04 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2APAAC6AsBd/xK90HYNWRsBAQEBAQEBBQEBAREBAQMDAQEBgWsEAQEBCwGEPIQpj1gBAQEBAQEGgRGKCYUxihaBewkBAQEBAQEBAQE3AQGEOwMCAoQwNgcOAg4BAQEEAQEBAQEFAwGFWIYqAgEDIwRSEBgNAiYCAkcQBhOFdbBidX8zGoozgQ4oAYFkikZ4gQeBETODHYdVgl4Ej0M3hkBDlnWCLpVRDI4oA4suqhoJggFNLgqDJ1CDNxeOMGeObQEB X-IPAS-Result: A2APAAC6AsBd/xK90HYNWRsBAQEBAQEBBQEBAREBAQMDAQEBgWsEAQEBCwGEPIQpj1gBAQEBAQEGgRGKCYUxihaBewkBAQEBAQEBAQE3AQGEOwMCAoQwNgcOAg4BAQEEAQEBAQEFAwGFWIYqAgEDIwRSEBgNAiYCAkcQBhOFdbBidX8zGoozgQ4oAYFkikZ4gQeBETODHYdVgl4Ej0M3hkBDlnWCLpVRDI4oA4suqhoJggFNLgqDJ1CDNxeOMGeObQEB X-IronPort-AV: E=Sophos;i="5.68,266,1569254400"; d="scan'208";a="207138653" Received: from unknown (HELO [192.168.1.222]) ([118.208.189.18]) by icp-osb-irony-out4.iinet.net.au with ESMTP; 04 Nov 2019 18:55:02 +0800 Subject: [PATCH v9 05/17] xfs: merge freeing of mp names and mp From: Ian Kent To: linux-xfs Cc: Christoph Hellwig , "Darrick J. Wong" , Brian Foster , Eric Sandeen , David Howells , Dave Chinner , Al Viro Date: Mon, 04 Nov 2019 18:55:02 +0800 Message-ID: <157286490216.18393.1751888232608516285.stgit@fedora-28> In-Reply-To: <157286480109.18393.6285224459642752559.stgit@fedora-28> References: <157286480109.18393.6285224459642752559.stgit@fedora-28> User-Agent: StGit/unknown-version MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org 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 Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 14 ++++++-------- 1 file 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 *