Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4348634ybz; Tue, 28 Apr 2020 09:46:47 -0700 (PDT) X-Google-Smtp-Source: APiQypJsio0ciln0G6pxt3tLptQ6BHqwjhYZwnQpwlK3lPTgVJHDaIWsuydupnvp4aRukFcKMfuC X-Received: by 2002:a50:f005:: with SMTP id r5mr21952728edl.376.1588092407179; Tue, 28 Apr 2020 09:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588092407; cv=none; d=google.com; s=arc-20160816; b=zl844wbSrD5DbOdGTXVi2/WGER8U29qjglp1+ddG4XGHd2sJGyWQDG9GMU2eA7tcCG b67RtVPPLh5M2+2QsUwEk2QkuMYwW13COdlhdhanWpd6WRqMAOd8ejSnAhff01Y6AHr3 jxWVtONMDtl1FmLu+tq8/WGQQ+bQBTaTmJAhhpC01258uGjXtNPVg8U8Yo/IoAs9xXei fE4BOeg4wfaEJrgYhdKcp/bEhbtmOY7K4MZfTa115IbNW2M78dRbt8JEuZ6TrKFtzUX5 MmQ4iURXoqYyRlmrCf5Z4x3ys2km10EV6enQrDssgHCqHIkyajfwnxpGkdlshncNMd5O zAXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rJwtOAK7FJLARXRqYirTbsfm8IhxryMi6A2ioZGaheU=; b=jJR8VQJy7h5ad2GT/F7w5qf68JrHC9T1dfJYxc1Huecrbt7si5suD2t+fqVuKEg96L D4CrE77tkHAv89ya3l4aTJ9FJJwuDmkSBt5k/PnBniAONKBCc13gGqhmE27VL3mIppZO E2/9Lu5z8OerhbOeo1EB93pdGQWDi0uKwaKiEmbOgPb0ZQ2RweCcxfD57i5cmeRqcqgX W6Kym8GmtvedVcQSff6LzKGoDmw40GY+Ucvj7ukq3B1owrDCwYQ058ez8EQfQ4UEWL53 v76UuQYm8pU9tDm6iFSuS+PZOUJzv5D1vMiUjoInc1cBr/CDL/UYo1cy4Vn5NzWP14O6 exZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TPFJKVwB; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r13si2117805eja.317.2020.04.28.09.46.22; Tue, 28 Apr 2020 09:46:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TPFJKVwB; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgD1QqJ (ORCPT + 99 others); Tue, 28 Apr 2020 12:46:09 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:30565 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728084AbgD1QqJ (ORCPT ); Tue, 28 Apr 2020 12:46:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588092368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJwtOAK7FJLARXRqYirTbsfm8IhxryMi6A2ioZGaheU=; b=TPFJKVwBY0Cue2fWaWqVciMRHR9oqItTunuocDAktCFjKiL+EMRSk8+XWTv+fEgaB7+QVp C9Lymbnp9YqwFvNS3UobDRuJowrSsaSceMgvVqVFCDQDMyCD+VJOhrkwekOtKbI5IYrBMk FqC/ot9OHm+i0qW0dKd3Y0XVwMCz+do= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-QaSMl1vKMDqIBoHjuzwJhQ-1; Tue, 28 Apr 2020 12:46:06 -0400 X-MC-Unique: QaSMl1vKMDqIBoHjuzwJhQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BD4A8018AD; Tue, 28 Apr 2020 16:46:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0A2C1002388; Tue, 28 Apr 2020 16:46:01 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk Subject: [PATCH v2 14/17] ext4: add ext4_fc_free for the new mount API Date: Tue, 28 Apr 2020 18:45:33 +0200 Message-Id: <20200428164536.462-15-lczerner@redhat.com> In-Reply-To: <20200428164536.462-1-lczerner@redhat.com> References: <20200428164536.462-1-lczerner@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Lukas Czerner --- fs/ext4/super.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9e10c42c300c..df7d1a724f1b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -95,6 +95,7 @@ static void ext4_apply_options(struct fs_context *fc, s= truct super_block *sb); static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *= param); static int ext4_get_tree(struct fs_context *fc); static int ext4_reconfigure(struct fs_context *fc); +static void ext4_fc_free(struct fs_context *fc); =20 /* * Lock ordering @@ -128,6 +129,7 @@ static const struct fs_context_operations ext4_contex= t_ops =3D { .parse_param =3D ext4_parse_param, .get_tree =3D ext4_get_tree, .reconfigure =3D ext4_reconfigure, + .free =3D ext4_fc_free, }; =20 #if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defin= ed(CONFIG_EXT4_USE_FOR_EXT2) @@ -1958,6 +1960,19 @@ struct ext4_fs_context { ext4_fsblk_t s_sb_block; }; =20 +static void ext4_fc_free(struct fs_context *fc) +{ + struct ext4_fs_context *ctx =3D fc->fs_private; + int i; + + if (!ctx) + return; + + for (i =3D 0; i < EXT4_MAXQUOTAS; i++) + kfree(ctx->s_qf_names[i]); + kfree(ctx); +} + #ifdef CONFIG_QUOTA /* * Note the name of the specified quota file. --=20 2.21.1