在 2008-10-28二的 18:02 -0700,Andrew Morton写道: > 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. > -- Thanks, this patch fixed it for me. Signed-off-by: Mingming Cao <cmm@xxxxxxxxxx> Index: linux-2.6.28-rc2/fs/quota_v2.c =================================================================== --- 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 = 0xffffffff; info->dqi_maxilimit = 0xffffffff; } else { - info->dqi_maxblimit = 0x7fffffffffffffff; - info->dqi_maxilimit = 0x7fffffffffffffff; + info->dqi_maxblimit = 0x7fffffffffffffffULL; + info->dqi_maxilimit = 0x7fffffffffffffffULL; } info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); > 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 -- 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