Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3052180ybp; Sun, 6 Oct 2019 03:47:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJCRr/VyP27nf9gLRBHTO3Pa2a1mcBRMHwSm8h7Rt0XHX/nDQZfBC7qUOUSzZ4bG1mRsfj X-Received: by 2002:a05:6402:794:: with SMTP id d20mr23933419edy.20.1570358866510; Sun, 06 Oct 2019 03:47:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1570358866; cv=pass; d=google.com; s=arc-20160816; b=dIhetuDXWsOvAfZNroX9UgJl6I1VgIbGoOej0DFS8olxea566VVPj6g3Vt5UR6FCnN WozfNyQoeFhqVQCFJn6vU/EkAgc218gbgVtLDb6iqTRtyruBNfOHYlE0lOPeK/LLPc6o VRJKeSJAvlLIqdEtznsku7Bz27047Vy2gZFyN4HB8HiQil5OVaKIo3g1b+jwyDbJNpsA 8PcSCJ+iLOgf/pQ5o/yQKhO+hVdDrSFjxKOq0aRCla2nt5MBCR1wkjriaJ8PJBu/B2XC RbLbSAlVqRmBCqU4RKsvhyKhw1eCDiRcT5jrqRpK4yNMSpO6d13qb32WDbsY+2FKzTnv 7KlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:subject:message-id:cc:to:from:dkim-signature; bh=NoGSNU0s/AdxfmdrNPrBvuGX45XVZ4o5yKoJDmyajws=; b=Ij56jCPr+mK5/M+kddgnhw0X3fsDfl/mXMsCoI4rOjVo5/X/m8o/0KZe1+EAQ6jEJA x8ygauxVhVsk6pxY9OBBO9ohi1r8dGYCRaYCXzTVCwoTSwz3a1UFSL7p767dfb496/hV vfzhJzX/tJxr/Tf4dp9bGqNP1CbQFyKBIm5e26LNYt0HeXi7yCo2+r6p81OAnMUNWPGK g/HVOIrMFTpM3a2bAMuLbkzZrZgNb5yC+SYbv+NT2Z3YTOIzCHtViRRBCzwTUK1KyrzN RbD1qk9vFBegnl8yKk1yegY89qvBX93uzu6a3HGzahMKES6rnhhdOTGeTvQr16txTj1a 1peg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=Ebc+3pfQ; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci22si5472836ejb.162.2019.10.06.03.47.04; Sun, 06 Oct 2019 03:47:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=Ebc+3pfQ; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726224AbfJFKq3 (ORCPT + 99 others); Sun, 6 Oct 2019 06:46:29 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21653 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbfJFKq3 (ORCPT ); Sun, 6 Oct 2019 06:46:29 -0400 X-Greylist: delayed 916 seconds by postgrey-1.27 at vger.kernel.org; Sun, 06 Oct 2019 06:46:26 EDT ARC-Seal: i=1; a=rsa-sha256; t=1570357843; cv=none; d=zoho.com.cn; s=zohoarc; b=P+7aT3TSZBXnxh6f7SyVjkTiCD92rbvuWgxsIytoWXuCZO2iqeQPMR/LEWr/o+qzh40pnpY8mFMkdwmrKlgDG4RM5+Uccjzcwvnz0eIFWJfdMQFkuQa4nrIOZhtjBZGPsLsoDwnLk2wbS0aG46lYgGGi/nnTj45c67V8nBuvqac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1570357843; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=NoGSNU0s/AdxfmdrNPrBvuGX45XVZ4o5yKoJDmyajws=; b=XArQAFzkPz/ecYBJKTONPrv68JOJkqlx6woavMver+c65Y5K8EufRsMfBocPPToOeIyVG4+4y2rLJxCCsl1MegW0E6e9FwGpKsxNWx9DyO3eWTdrgMZibXptoYYUyhBd0iUSSDS2+OnWdVkxn+nl7Bo1imVAqbbhPMMWVfLkOoM= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570357843; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; l=1808; bh=NoGSNU0s/AdxfmdrNPrBvuGX45XVZ4o5yKoJDmyajws=; b=Ebc+3pfQROKvQErkhIJW+6luOUdIzkCNx+bBRtGW3aHxlnSTrvAEyRiZy02sEKzK NdM31B5C8sw9cvvbIesT9TR8WAmqEsQukdtp9Rhwqpq/jcx1/QwNTHyBXv2KHSuUD/W pgGkrBmuVDr92qWGUZZaGRD7yIQ3n6H+KIvmFjrY= Received: from localhost.localdomain (116.30.195.234 [116.30.195.234]) by mx.zoho.com.cn with SMTPS id 1570357841513677.3525053323079; Sun, 6 Oct 2019 18:30:41 +0800 (CST) From: Chengguang Xu To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, Chengguang Xu Message-ID: <20191006103028.31299-1-cgxu519@mykernel.net> Subject: [PATCH] ext4: code cleanup for get_next_id Date: Sun, 6 Oct 2019 18:30:28 +0800 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Now the checks in ext4_get_next_id() and dquot_get_next_id() are almost the same, so just call dquot_get_next_id() instead of ext4_get_next_id(). Signed-off-by: Chengguang Xu --- fs/ext4/super.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index dd654e53ba3d..d1bdffcbfcee 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1374,7 +1374,6 @@ static ssize_t ext4_quota_write(struct super_block *s= b, int type, static int ext4_quota_enable(struct super_block *sb, int type, int format_= id, =09=09=09 unsigned int flags); static int ext4_enable_quotas(struct super_block *sb); -static int ext4_get_next_id(struct super_block *sb, struct kqid *qid); =20 static struct dquot **ext4_get_dquots(struct inode *inode) { @@ -1392,7 +1391,7 @@ static const struct dquot_operations ext4_quota_opera= tions =3D { =09.destroy_dquot=09=09=3D dquot_destroy, =09.get_projid=09=09=3D ext4_get_projid, =09.get_inode_usage=09=3D ext4_get_inode_usage, -=09.get_next_id=09=09=3D ext4_get_next_id, +=09.get_next_id=09=09=3D dquot_get_next_id, }; =20 static const struct quotactl_ops ext4_qctl_operations =3D { @@ -6019,18 +6018,6 @@ static ssize_t ext4_quota_write(struct super_block *= sb, int type, =09} =09return len; } - -static int ext4_get_next_id(struct super_block *sb, struct kqid *qid) -{ -=09const struct quota_format_ops=09*ops; - -=09if (!sb_has_quota_loaded(sb, qid->type)) -=09=09return -ESRCH; -=09ops =3D sb_dqopt(sb)->ops[qid->type]; -=09if (!ops || !ops->get_next_id) -=09=09return -ENOSYS; -=09return dquot_get_next_id(sb, qid); -} #endif =20 static struct dentry *ext4_mount(struct file_system_type *fs_type, int fla= gs, --=20 2.21.0