From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: [RFC] quota: 64-bit limits with vfs, updated Date: Fri, 21 Mar 2008 09:04:03 +0800 Message-ID: <20080321010403.GA2971@webber.adilger.int> References: <200803061641.12274.andrew.perepechko@sun.com> <200803161421.18402.andrew.perepechko@sun.com> <20080317143524.GF17307@duck.suse.cz> <200803210037.38094.andrew.perepechko@sun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Johann Lombardi , Zhiyong Landen tian , Alex Lyashkov To: Andrew Perepechko Return-path: Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:57623 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbYCUBEK (ORCPT ); Thu, 20 Mar 2008 21:04:10 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m2L149Kh004982 for ; Thu, 20 Mar 2008 18:04:09 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JY2007012SSAY00@fe-sfbay-10.sun.com> (original mail from adilger@sun.com) for linux-fsdevel@vger.kernel.org; Thu, 20 Mar 2008 18:04:09 -0700 (PDT) In-reply-to: <200803210037.38094.andrew.perepechko@sun.com> Content-disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mar 21, 2008 00:37 +0300, Andrew Perepechko wrote: > +#define REV_ASSERT(r) BUG_ON((rev) != 0 && (rev) != 1) Umm, "r" and "rev" are not consistent above... Since this assertion is only on the in-memory quota structure, it would probably be better to have something like #define REV_R0 0x12340000 #define REV_R1 0x12340001 and when unpacking the on-disk revision number or it with REV_OFFSET and #define REV_ASSERT(revno) BUG_ON((revno) != REV_R0 && (revno) != REV_R1) That detects the common case of memory being zeroed for some reason. It will also easily detect if you aren't properly swabbing the revision and unmasking the 0x1234000 from the in-memory structure. Just a thought... some people may not like this idea, but I dislike using "0" as a magic number for anything. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.