Re: [PATCH 14/14] quota: Support 64-bit quota format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Oct 2008 17:41:51 -0700
Mingming Cao <cmm@xxxxxxxxxx> 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 <andrew.perepechko@xxxxxxx>
> > Signed-off-by: Jan Kara <jack@xxxxxxx>
> > ---
> >  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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux