From patchwork Wed Oct 26 07:11:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqiang Yang X-Patchwork-Id: 121863 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0DB251007D9 for ; Wed, 26 Oct 2011 20:07:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754811Ab1JZJHs (ORCPT ); Wed, 26 Oct 2011 05:07:48 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:49521 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754674Ab1JZJHs (ORCPT ); Wed, 26 Oct 2011 05:07:48 -0400 Received: by iaby12 with SMTP id y12so1511707iab.19 for ; Wed, 26 Oct 2011 02:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=WOgLHkTlLLGfPfqNEqkVOwEL0tbbgRIl+ISoCIyxDYI=; b=lfHksmFEqF8ArW5ftVlAFYpJ37Ro1z8HPHAjwEs9BYVXyuOtbXyFSUw+5hEy7YDF0G kUZmn+/GYfUgApaZ1yoxvdFStUVCSfTMw03T9ywDTjrh1ltjyrfW3vI3ySZQnoOukOjv qYbHHJNAwe2Megp/A8KSWsBnV+LOD/P+HvRi0= Received: by 10.231.67.71 with SMTP id q7mr1557183ibi.45.1319620067534; Wed, 26 Oct 2011 02:07:47 -0700 (PDT) Received: from localhost.localdomain ([159.226.43.42]) by mx.google.com with ESMTPS id e2sm2156899ibe.0.2011.10.26.02.07.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Oct 2011 02:07:45 -0700 (PDT) From: Yongqiang Yang To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org, Yongqiang Yang Subject: [PATCH 1/4] ext4: fold two if statements into one Date: Wed, 26 Oct 2011 15:11:49 +0800 Message-Id: <1319613112-16807-1-git-send-email-xiaoqiangnk@gmail.com> X-Mailer: git-send-email 1.7.5.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Yongqiang Yang --- fs/ext4/extents.c | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index f1ed90b..f887023 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4082,18 +4082,17 @@ got_allocated_blocks: */ reserved_clusters = get_reserved_cluster_alloc(inode, map->m_lblk, allocated); - if (map->m_flags & EXT4_MAP_FROM_CLUSTER) { - if (reserved_clusters) { - /* - * We have clusters reserved for this range. - * But since we are not doing actual allocation - * and are simply using blocks from previously - * allocated cluster, we should release the - * reservation and not claim quota. - */ - ext4_da_update_reserve_space(inode, - reserved_clusters, 0); - } + if ((map->m_flags & EXT4_MAP_FROM_CLUSTER) && + reserved_clusters) { + /* + * We have clusters reserved for this range. + * But since we are not doing actual allocation + * and are simply using blocks from previously + * allocated cluster, we should release the + * reservation and not claim quota. + */ + ext4_da_update_reserve_space(inode, + reserved_clusters, 0); } else { BUG_ON(allocated_clusters < reserved_clusters); /* We will claim quota for all newly allocated blocks.*/