From patchwork Thu Mar 30 19:42:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9654961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2AF1F60113 for ; Thu, 30 Mar 2017 19:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A169284CB for ; Thu, 30 Mar 2017 19:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BA99285E0; Thu, 30 Mar 2017 19:42:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944B9284CB for ; Thu, 30 Mar 2017 19:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934635AbdC3TmX (ORCPT ); Thu, 30 Mar 2017 15:42:23 -0400 Received: from mailrelay101.isp.belgacom.be ([195.238.20.128]:64132 "EHLO mailrelay101.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934561AbdC3TmW (ORCPT ); Thu, 30 Mar 2017 15:42:22 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AnGsZEBA/raN63L9VoWMEUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPX+rsbcNUDSrc9gkEXOFd2CrakV1qyG4uu5Aj1IyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+?= =?us-ascii?q?KPjrFY7OlcS30P2594HObwlSijewZbN/IA+1oAjVucUanIVvJ6IswRbVv3VEfP?= =?us-ascii?q?hby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnD?= =?us-ascii?q?UBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulS?= =?us-ascii?q?wKMSMy/mPKhcxqlK9VoAyvqQFxzYDXZ4+YL+Zycr/HcN8GX2dNQtpdWipcCY28?= =?us-ascii?q?dYsPCO8BMP5YoYbnvFQOrAGxBQ+xD+3v0D9HmGL50rMg0+QgDQ7G3xErEtUAsH?= =?us-ascii?q?vOt9r1OrwfUfu2zKjIyzXMce9W1S3m54fWax0sp+yHU7FoccfJykQjChnJgkuf?= =?us-ascii?q?pIHqJT+Zy/4Bv3aU4udiU++klnQppBtroje1w8chkozJhoUIxV/a7Sh524M1Jc?= =?us-ascii?q?GgSE58fN6kDINctyGEOItyRcMvW2VouCEmxbIcvZ67fC8KyI87xxLFb/yHdJSH?= =?us-ascii?q?7QjnVOmMJjd4gWhqeLO5hxqq8EigzPPzVtWs3VtJsyZJiMfAu38C2hDJ98SLUO?= =?us-ascii?q?Vx80ij1DqX0gDc8OBEIUQ6larBLJ4hx6Y9lpQJvkvYEC/7g172jKyWd0Ui5Oeo?= =?us-ascii?q?9/7rba74qZOELY97lhn+Mrgymsy4Gek3KAsOX3Ce+emn0L3j/Ev5QKhFj/EvnK?= =?us-ascii?q?nZt43aJcIGqaGjHw9V04Ej6xClAzehytQYkmENLEhZdxKfk4jpJ1bOLej6Dfil?= =?us-ascii?q?n1uskyxmx+vbPr36HJrBNGTMkLDkfbxl8U5T1BIzzcxD55JTErwBJPPzWknstN?= =?us-ascii?q?3XFxM5MBK7w/zhCNpj0oMTQnyPAqCHP6PIq1OI5fwgI/OKZIALvDbxMf8l5+Th?= =?us-ascii?q?jXUhg18SYbGp3YcLaHC/BvlmJ0SZYXzxgtYOCGsKsBE+Q/H0h12cTzFTY22/X7?= =?us-ascii?q?wz5j4lEoKqF4TDSZ63gLyHwii7GodaZmdcClCDCX3obZmLW+8QaCKOJc9sijIE?= =?us-ascii?q?WqK6RI8vzhyurwz6yrphLuXK5i0Ur4ns28Ymr9HUwDg0+SZ5EIy41HuRSGc8ym?= =?us-ascii?q?oLXzoe2KF5vFw4xFCe16Rxn/1fE5pU/fwfASkgMpuJ4eVwCtn0Eizbc9uEUlet?= =?us-ascii?q?QZ3yDzg7QPoqwM4Iblo7Edj03UOL5DajH7JAz+/DP5cz6K+Jh3U=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D/AgAuX91Y//cB9FFdHAwGGAELAQUBg?= =?us-ascii?q?kBtJxqBK45mkQoBkxeCD4IOH4YDgzlAGAEBAQEBAQEBAQEBaiiCMyCCcC8jKXE?= =?us-ascii?q?kE4l+Ea9yOoQQhneGToxegkoFiSKGRI0EkkMNkTdIkyUfOIEFOx0YhEoBTx2BZ?= =?us-ascii?q?T41h1IEgjkBAQE?= X-IPAS-Result: =?us-ascii?q?A2D/AgAuX91Y//cB9FFdHAwGGAELAQUBgkBtJxqBK45mkQo?= =?us-ascii?q?BkxeCD4IOH4YDgzlAGAEBAQEBAQEBAQEBaiiCMyCCcC8jKXEkE4l+Ea9yOoQQh?= =?us-ascii?q?neGToxegkoFiSKGRI0EkkMNkTdIkyUfOIEFOx0YhEoBTx2BZT41h1IEgjkBAQE?= Received: from 247.1-244-81.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([81.244.1.247]) by relay.skynet.be with ESMTP; 30 Mar 2017 21:42:19 +0200 From: Fabian Frederick To: Andrew Morton Cc: Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 1/1 linux-next] fs/affs: free affs_sb_info in put_super() Date: Thu, 30 Mar 2017 21:42:15 +0200 Message-Id: <20170330194215.26379-1-fabf@skynet.be> X-Mailer: git-send-email 2.9.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kill_block_super() calls generic_shutdown_super() calling FS put_user() where we generally free superblock specific information. This removes unneeded affs_kill_sb() sbi is automatically reserved in fill_super() so there is no need to test it. Signed-off-by: Fabian Frederick --- fs/affs/super.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/fs/affs/super.c b/fs/affs/super.c index c2c27a8..f273203 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -46,9 +46,14 @@ static void affs_put_super(struct super_block *sb) { struct affs_sb_info *sbi = AFFS_SB(sb); - pr_debug("%s()\n", __func__); + pr_debug("%s()\n", __func__); cancel_delayed_work_sync(&sbi->sb_work); + affs_free_bitmap(sb); + affs_brelse(sbi->s_root_bh); + kfree(sbi->s_prefix); + mutex_destroy(&sbi->s_bmlock); + kfree(sbi); } static int @@ -604,24 +609,11 @@ static struct dentry *affs_mount(struct file_system_type *fs_type, return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super); } -static void affs_kill_sb(struct super_block *sb) -{ - struct affs_sb_info *sbi = AFFS_SB(sb); - kill_block_super(sb); - if (sbi) { - affs_free_bitmap(sb); - affs_brelse(sbi->s_root_bh); - kfree(sbi->s_prefix); - mutex_destroy(&sbi->s_bmlock); - kfree(sbi); - } -} - static struct file_system_type affs_fs_type = { .owner = THIS_MODULE, .name = "affs", .mount = affs_mount, - .kill_sb = affs_kill_sb, + .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV, }; MODULE_ALIAS_FS("affs");