From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mingming Cao Subject: Re: [PATCH 14/14] quota: Support 64-bit quota format Date: Wed, 29 Oct 2008 14:31:47 -0700 Message-ID: <1225315907.6405.8.camel@mingming-laptop> 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> <20081028180220.fa4094fd.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org, andrew.perepechko@sun.com To: Andrew Morton Return-path: Received: from e32.co.us.ibm.com ([32.97.110.150]:49689 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbYJ2Vbx (ORCPT ); Wed, 29 Oct 2008 17:31:53 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e32.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id m9TLUtmq020853 for ; Wed, 29 Oct 2008 15:30:55 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9TLVrqR143542 for ; Wed, 29 Oct 2008 15:31:53 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9TLVLRM006227 for ; Wed, 29 Oct 2008 15:31:24 -0600 In-Reply-To: <20081028180220.fa4094fd.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: =E5=9C=A8 2008-10-28=E4=BA=8C=E7=9A=84 18:02 -0700=EF=BC=8CAndrew Morto= n=E5=86=99=E9=81=93=EF=BC=9A > On Tue, 28 Oct 2008 17:41:51 -0700 > Mingming Cao wrote: >=20 > > ___ 2008-10-27______ 13:11 +0100___Jan Kara_________ > > > Implement conversion functions for new version (version 1) of quo= ta > > > format which supports 64-bit block and inode limits and 64-bit in= ode > > > usage. The original implementation has been written by Andrew Per= epechko. > > >=20 > > > 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(-) > > >=20 > > > 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 > >=20 > > ... > >=20 > >=20 > > > @@ -73,7 +90,13 @@ static int v2_read_file_info(struct super_bloc= k *sb, int type) > > > struct mem_dqinfo *info =3D sb_dqinfo(sb, type); > > > struct qtree_mem_dqinfo *qinfo; > > > ssize_t size; > > > + int version =3D v2_check_quota_file_header(sb, type); > > >=20 > > > + if (version < 0) { > > > + printk(KERN_WARNING "Cannot identify quota file version on " > > > + "device %s: %d\n", sb->s_id, version); > > > + return -1; > > > + } > > > size =3D sb->s_op->quota_read(sb, type, (char *)&dinfo, > > > sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); > > > if (size !=3D sizeof(struct v2_disk_dqinfo)) { > > > @@ -88,9 +111,14 @@ static int v2_read_file_info(struct super_blo= ck *sb, int type) > > > return -1; > > > } > > > qinfo =3D info->dqi_priv; > > > - /* limits are stored as unsigned 32-bit data */ > > > - info->dqi_maxblimit =3D 0xffffffff; > > > - info->dqi_maxilimit =3D 0xffffffff; > > > + if (version =3D=3D 0) { > > > + /* limits are stored as unsigned 32-bit data */ > > > + info->dqi_maxblimit =3D 0xffffffff; > > > + info->dqi_maxilimit =3D 0xffffffff; > > > + } else { > > > + info->dqi_maxblimit =3D 0x7fffffffffffffff; > > > + info->dqi_maxilimit =3D 0x7fffffffffffffff; > > > + } > >=20 > > I got some compile warning saying=20 > >=20 > > fs/quota_v2.c: In function ___v2_read_file_info___: > > fs/quota_v2.c:119: warning: integer constant is too large for ___lo= ng___ type > > fs/quota_v2.c:120: warning: integer constant is too large for ___lo= ng___ type > >=20 > > qsize_t is defined as __u64, however... > >=20 >=20 > yup, those 64-bit numbers need ULL added to them. >=20 > This might generate warnings on u64-is-long architectures, dunno. > -- Thanks, this patch fixed it for me. Signed-off-by: Mingming Cao Index: linux-2.6.28-rc2/fs/quota_v2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-2.6.28-rc2.orig/fs/quota_v2.c 2008-10-28 16:01:47.000000000 -= 0700 +++ linux-2.6.28-rc2/fs/quota_v2.c 2008-10-29 13:57:17.000000000 -0700 @@ -116,8 +116,8 @@ static int v2_read_file_info(struct supe info->dqi_maxblimit =3D 0xffffffff; info->dqi_maxilimit =3D 0xffffffff; } else { - info->dqi_maxblimit =3D 0x7fffffffffffffff; - info->dqi_maxilimit =3D 0x7fffffffffffffff; + info->dqi_maxblimit =3D 0x7fffffffffffffffULL; + info->dqi_maxilimit =3D 0x7fffffffffffffffULL; } info->dqi_bgrace =3D le32_to_cpu(dinfo.dqi_bgrace); info->dqi_igrace =3D le32_to_cpu(dinfo.dqi_igrace); > To unsubscribe from this list: send the line "unsubscribe linux-fsdev= el" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html