From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D70E57FDB for ; Wed, 19 Feb 2014 18:27:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id BC673304081 for ; Wed, 19 Feb 2014 16:27:18 -0800 (PST) Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id EwVQL7ZHpyjEah8V for ; Wed, 19 Feb 2014 16:27:16 -0800 (PST) Date: Thu, 20 Feb 2014 11:27:13 +1100 From: Dave Chinner Subject: Re: [PATCH 4/9] xfs: Use defines for CRC offsets in all cases Message-ID: <20140220002713.GI4916@dastard> References: <1392767549-25574-1-git-send-email-sandeen@redhat.com> <1392767549-25574-5-git-send-email-sandeen@redhat.com> <530463C6.6050509@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <530463C6.6050509@oracle.com> 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: Jeff Liu Cc: Eric Sandeen , xfs@oss.sgi.com On Wed, Feb 19, 2014 at 03:56:54PM +0800, Jeff Liu wrote: > Hi Eric, > > I read the previous comments from Dave about using defines for CRC offsets, > and with a grep search after applying this patch, looks there have another > two places maybe we should switch them to the macros as well: > > fs/xfs/xfs_log.c: > Do we need a log record crc offset macros for offsetof(struct xlog_rec_header, h_crc))? > > xfs_dinode.h: > we added the XFS_DINODE_CRC_OFF, just use it at below routine? > > static inline uint xfs_dinode_size(int version) > { > if (version == 3) > return sizeof(struct xfs_dinode); > return offsetof(struct xfs_dinode, di_crc); > } No, that's a different case - it's not being used for determining the offset of a CRC varaible - it's being used to calculate the size of the version 2 inode core. Hence it should remain open coded like because it has a different purpose in life.... Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs