From patchwork Mon Jan 24 19:18:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coly Li X-Patchwork-Id: 80229 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 665371007D1 for ; Tue, 25 Jan 2011 05:54:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753720Ab1AXSyZ (ORCPT ); Mon, 24 Jan 2011 13:54:25 -0500 Received: from mail-pv0-f174.google.com ([74.125.83.174]:35639 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988Ab1AXSyY (ORCPT ); Mon, 24 Jan 2011 13:54:24 -0500 Received: by pva4 with SMTP id 4so728515pva.19 for ; Mon, 24 Jan 2011 10:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=WDRSXDQME1Wgh8xQ88ObXul2+5FI4nQkcoBKwATHdcI=; b=pENRD7gtFBUkiejgF60HCtjK71W2fADpUhzdcVrtWnMWXyI1wFfhpZMyudJ2CKws1v 42uWQ8A3/g+6PXiKxqzj+t+KanbIXJjb0G7RQ0gBHrTcazf7I+OnjPX/ony0pWrbsgEx n3RxRbAG9BIiDvgdpedxC+BqUobrOLl/UXVLE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=b0m/jRj69co3hENFglRq3BB9wD6knIz68mndTa3VGQo7F3VeqjEMYSnv73sHkd5qST SZ1ROso2J/sWQpVBHRBwnynAjamu54UOBwcN6+ZGejzRrYDUcme3Ef0AAUiopsUlFXmT u96eUlDF73EJQiXO0TFhVxsP+pBPSxI4tYt3M= Received: by 10.142.147.12 with SMTP id u12mr4169514wfd.160.1295895264015; Mon, 24 Jan 2011 10:54:24 -0800 (PST) Received: from enigma.site ([123.122.99.46]) by mx.google.com with ESMTPS id w22sm17772471wfd.7.2011.01.24.10.54.21 (version=SSLv3 cipher=RC4-MD5); Mon, 24 Jan 2011 10:54:23 -0800 (PST) From: Coly Li To: linux-ext4@vger.kernel.org Cc: Coly Li Subject: [PATCH] __ext4_get_inode_loc: use s_inodes_per_block directly Date: Tue, 25 Jan 2011 03:18:19 +0800 Message-Id: <1295896699-7314-1-git-send-email-bosong.ly@taobao.com> X-Mailer: git-send-email 1.7.3.2 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Coly Li In __ext4_get_inode_loc(), inodes_per_block is calculated by (EXT4_BLOCK_SIZE(sb) / EXT4_INODE_SIZE(sb)). This is unncessary, the value can be found directly from s_inodes_per_block. Signed-off-by: Coly Li --- fs/ext4/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9f7f9e4..837c5a6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4668,7 +4668,7 @@ static int __ext4_get_inode_loc(struct inode *inode, /* * Figure out the offset within the block group inode table */ - inodes_per_block = (EXT4_BLOCK_SIZE(sb) / EXT4_INODE_SIZE(sb)); + inodes_per_block = EXT4_SB(sb)->s_inodes_per_block; inode_offset = ((inode->i_ino - 1) % EXT4_INODES_PER_GROUP(sb)); block = ext4_inode_table(sb, gdp) + (inode_offset / inodes_per_block);