From patchwork Tue Jul 19 04:02:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqiang Yang X-Patchwork-Id: 105382 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 B663BB6F69 for ; Tue, 19 Jul 2011 14:06:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751021Ab1GSEGg (ORCPT ); Tue, 19 Jul 2011 00:06:36 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:49578 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928Ab1GSEGg (ORCPT ); Tue, 19 Jul 2011 00:06:36 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so3703318iwn.19 for ; Mon, 18 Jul 2011 21:06:36 -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:in-reply-to:references; bh=Ie1Tu88GR+CzDxMytq76iuGmlObaaA/7K8DTpF64sYU=; b=haNS1q6Ba1yhAlj8LPgcYYzqV1LrXflyDWGUYsDpvg+uzzuTnmfWETIoDPSND1Vrwo iAbRQtX7WbDZePKHW6ije/Ep1+j4NZkvI2SjIwV9Cx7IzGqi0qIg5IlM2A4AAouJ1FRF UebDiT+AJkKcsijqqwTpV5bmrpXOhIqapu6Qc= Received: by 10.43.47.196 with SMTP id ut4mr7321699icb.16.1311048396156; Mon, 18 Jul 2011 21:06:36 -0700 (PDT) Received: from localhost.localdomain ([159.226.43.42]) by mx.google.com with ESMTPS id vj5sm5701144icb.11.2011.07.18.21.06.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jul 2011 21:06:35 -0700 (PDT) From: Yongqiang Yang To: linux-ext4@vger.kernel.org Cc: adilger@dilger.ca, amir73il@gmail.com, tm@tao.ma, Yongqiang Yang Subject: [PATCH v2 05/11] ext4: let ext4_group_add_blocks() handle 0 blocks quickly Date: Tue, 19 Jul 2011 12:02:11 +0800 Message-Id: <1311048137-16400-6-git-send-email-xiaoqiangnk@gmail.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1311048137-16400-1-git-send-email-xiaoqiangnk@gmail.com> References: <1311048137-16400-1-git-send-email-xiaoqiangnk@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If ext4_group_add_blocks() is called with 0 block, it just return 0. Signed-off-by: Yongqiang Yang --- fs/ext4/mballoc.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) v1->v2: nothing changed. diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 48784eb..397e27c 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4680,6 +4680,9 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb, ext4_debug("Adding block(s) %llu-%llu\n", block, block + count - 1); + if (count == 0) + return 0; + ext4_get_group_no_and_offset(sb, block, &block_group, &bit); /* * Check to see if we are freeing blocks across a group