From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 14/14] quota: Support 64-bit quota format Date: Tue, 28 Oct 2008 18:02:20 -0700 Message-ID: <20081028180220.fa4094fd.akpm@linux-foundation.org> References: <1225109512852-git-send-email-jack@suse.cz> <12251095123763-git-send-email-jack@suse.cz> <12251095124166-git-send-email-jack@suse.cz> <1225109512758-git-send-email-jack@suse.cz> <12251095122803-git-send-email-jack@suse.cz> <12251095124165-git-send-email-jack@suse.cz> <1225109513735-git-send-email-jack@suse.cz> <12251095131095-git-send-email-jack@suse.cz> <12251095133646-git-send-email-jack@suse.cz> <12251095133281-git-send-email-jack@suse.cz> <12251095131431-git-send-email-jack@suse.cz> <1225109513299-git-send-email-jack@suse.cz> <12251095133700-git-send-email-jack@suse.cz> <122510951372-git-send-email-jack@suse.cz> <1225109513200-git-send-email-jack@suse.cz> <1225240911.6452.5.camel@mingming-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org, andrew.perepechko@sun.com To: Mingming Cao Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:51263 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbYJ2BC1 (ORCPT ); Tue, 28 Oct 2008 21:02:27 -0400 In-Reply-To: <1225240911.6452.5.camel@mingming-laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 28 Oct 2008 17:41:51 -0700 Mingming Cao wrote: > ___ 2008-10-27______ 13:11 +0100___Jan Kara_________ > > Implement conversion functions for new version (version 1) of quota > > format which supports 64-bit block and inode limits and 64-bit inode > > usage. The original implementation has been written by Andrew Perepechko. > > > > Signed-off-by: Andrew Perepechko > > Signed-off-by: Jan Kara > > --- > > fs/quota_v2.c | 140 ++++++++++++++++++++++++++++++++++++++++++++----------- > > fs/quotaio_v2.h | 26 ++++++++-- > > 2 files changed, 132 insertions(+), 34 deletions(-) > > > > diff --git a/fs/quota_v2.c b/fs/quota_v2.c > > index a371919..ac6668d 100644 > > --- a/fs/quota_v2.c > > +++ b/fs/quota_v2.c > > ... > > > > @@ -73,7 +90,13 @@ static int v2_read_file_info(struct super_block *sb, int type) > > struct mem_dqinfo *info = sb_dqinfo(sb, type); > > struct qtree_mem_dqinfo *qinfo; > > ssize_t size; > > + int version = v2_check_quota_file_header(sb, type); > > > > + if (version < 0) { > > + printk(KERN_WARNING "Cannot identify quota file version on " > > + "device %s: %d\n", sb->s_id, version); > > + return -1; > > + } > > size = sb->s_op->quota_read(sb, type, (char *)&dinfo, > > sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); > > if (size != sizeof(struct v2_disk_dqinfo)) { > > @@ -88,9 +111,14 @@ static int v2_read_file_info(struct super_block *sb, int type) > > return -1; > > } > > qinfo = info->dqi_priv; > > - /* limits are stored as unsigned 32-bit data */ > > - info->dqi_maxblimit = 0xffffffff; > > - info->dqi_maxilimit = 0xffffffff; > > + if (version == 0) { > > + /* limits are stored as unsigned 32-bit data */ > > + info->dqi_maxblimit = 0xffffffff; > > + info->dqi_maxilimit = 0xffffffff; > > + } else { > > + info->dqi_maxblimit = 0x7fffffffffffffff; > > + info->dqi_maxilimit = 0x7fffffffffffffff; > > + } > > I got some compile warning saying > > fs/quota_v2.c: In function ___v2_read_file_info___: > fs/quota_v2.c:119: warning: integer constant is too large for ___long___ type > fs/quota_v2.c:120: warning: integer constant is too large for ___long___ type > > qsize_t is defined as __u64, however... > yup, those 64-bit numbers need ULL added to them. This might generate warnings on u64-is-long architectures, dunno.