From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 07/10] quota: remove invalid optimization from quota_sync_all Date: Tue, 16 Feb 2010 03:44:53 -0500 Message-ID: <20100216084652.167390973@bombadil.infradead.org> References: <20100216084446.377980079@bombadil.infradead.org> Cc: swhiteho@redhat.com, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com To: jack@suse.cz Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:55704 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756115Ab0BPIqy (ORCPT ); Tue, 16 Feb 2010 03:46:54 -0500 Content-Disposition: inline; filename=make-quota_sync_all-generic Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Checking the "VFS" quota enabled and dirty bits from generic code means this code will never get called for other implementations, e.g. XFS and GFS2. Grabbing the reference on the superblock really isn't much overhead for a global Q_SYNC call, so just drop this optimization. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/quota/quota.c =================================================================== --- linux-2.6.orig/fs/quota/quota.c 2010-02-16 00:24:14.432004170 +0100 +++ linux-2.6/fs/quota/quota.c 2010-02-16 00:24:58.589255532 +0100 @@ -51,7 +51,6 @@ static int check_quotactl_permission(str static int quota_sync_all(int type) { struct super_block *sb; - int cnt; int ret; if (type >= MAXQUOTAS) @@ -66,20 +65,6 @@ restart: if (!sb->s_qcop || !sb->s_qcop->quota_sync) continue; - /* This test just improves performance so it needn't be - * reliable... */ - for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (type != -1 && type != cnt) - continue; - if (!sb_has_quota_active(sb, cnt)) - continue; - if (!info_dirty(&sb_dqopt(sb)->info[cnt]) && - list_empty(&sb_dqopt(sb)->info[cnt].dqi_dirty_list)) - continue; - break; - } - if (cnt == MAXQUOTAS) - continue; sb->s_count++; spin_unlock(&sb_lock); down_read(&sb->s_umount);