From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0F7C17F56 for ; Thu, 12 Dec 2013 01:38:37 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9CEB5AC00B for ; Wed, 11 Dec 2013 23:38:36 -0800 (PST) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id UX3YH7HcOYyeEwyO (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 11 Dec 2013 23:38:35 -0800 (PST) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rBC7cYZ3026625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 12 Dec 2013 07:38:35 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBC7cXpE020172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Dec 2013 07:38:34 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBC7cXR1020015 for ; Thu, 12 Dec 2013 07:38:33 GMT Message-ID: <52A967F5.6030005@oracle.com> Date: Thu, 12 Dec 2013 15:38:29 +0800 From: Jeff Liu MIME-Version: 1.0 Subject: [PATCH v2 4/8] xfs: introduce a common helper xfs_icluster_size_fsb List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: "xfs@oss.sgi.com" From: Jie Liu Introduce a common routine xfs_icluster_size_fsb() to calculate and return the number of file system blocks per inode cluster. Signed-off-by: Jie Liu --- fs/xfs/xfs_ialloc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/xfs/xfs_ialloc.h b/fs/xfs/xfs_ialloc.h index d86f8bd..812365d 100644 --- a/fs/xfs/xfs_ialloc.h +++ b/fs/xfs/xfs_ialloc.h @@ -28,6 +28,16 @@ struct xfs_btree_cur; /* Move inodes in clusters of this size */ #define XFS_INODE_BIG_CLUSTER_SIZE 8192 +/* Calculate and return the number of filesystem blocks per inode cluster */ +static inline int +xfs_icluster_size_fsb( + struct xfs_mount *mp) +{ + if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) + return 1; + return mp->m_inode_cluster_size >> mp->m_sb.sb_blocklog; +} + /* * Make an inode pointer out of the buffer/offset. */ -- 1.8.3.2 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs