From patchwork Fri Jul 15 21:41:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Ehrenberg X-Patchwork-Id: 104915 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 7776F1007D1 for ; Sat, 16 Jul 2011 07:42:45 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355Ab1GOVm2 (ORCPT ); Fri, 15 Jul 2011 17:42:28 -0400 Received: from smtp-out.google.com ([216.239.44.51]:34309 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752347Ab1GOVm0 (ORCPT ); Fri, 15 Jul 2011 17:42:26 -0400 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id p6FLgL1B014876; Fri, 15 Jul 2011 14:42:21 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1310766141; bh=GFoi/VVD+T5ReldSosSA3j9rzIo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Mupbdb8s8u0Yzz47Dmdig0GiGCTb2gWAgW2JkAYUgb+U/tk3YysW/6qMbbZzA/J13 ETFguRPH3oQoTQgI8u6WQ== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=FPCj3AZCLl+aRQIFZbYdcO6ZTSe4c7ok+tQLT//jUCUh8JjbdTSyPT4A19pULB1CR Ip9F7kfZQYalCLqnjmL0Q== Received: from dehrenberg-linux.mtv.corp.google.com (dehrenberg-linux.mtv.corp.google.com [172.18.96.157]) by wpaz33.hot.corp.google.com with ESMTP id p6FLgKON013579; Fri, 15 Jul 2011 14:42:20 -0700 Received: by dehrenberg-linux.mtv.corp.google.com (Postfix, from userid 134750) id 559EE1C3C93; Fri, 15 Jul 2011 14:42:20 -0700 (PDT) From: Dan Ehrenberg To: "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Sandeen Cc: Dan Ehrenberg Subject: [PATCH v2 2/2] ext4: Ignore a stripe width of 1 Date: Fri, 15 Jul 2011 14:41:55 -0700 Message-Id: <1310766115-4164-2-git-send-email-dehrenberg@google.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1310766115-4164-1-git-send-email-dehrenberg@google.com> References: <1310766115-4164-1-git-send-email-dehrenberg@google.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If the stripe width was set to 1, then this patch will ignore that stripe width and ext4 will act as if the stripe width were 0 with respect to optimizing allocations. Signed-off-by: Dan Ehrenberg Reviewed-by: Eric Sandeen --- fs/ext4/super.c | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9ea71aa..0a3745b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2383,17 +2383,27 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi) unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride); unsigned long stripe_width = le32_to_cpu(sbi->s_es->s_raid_stripe_width); + int ret; if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) - return sbi->s_stripe; + ret = sbi->s_stripe; - if (stripe_width <= sbi->s_blocks_per_group) - return stripe_width; + else if (stripe_width <= sbi->s_blocks_per_group) + ret = stripe_width; - if (stride <= sbi->s_blocks_per_group) - return stride; + else if (stride <= sbi->s_blocks_per_group) + ret = stride; + else + ret = 0; - return 0; + /* + * If the stripe width is 1, this makes no sense and + * we set it to 0 to turn off stripe handling code. + */ + if (ret <= 1) + ret = 0; + + return ret; } /* sysfs supprt */