From: anserper Date: Wed, 15 Jul 2009 13:28:47 +0000 (+0000) Subject: b=19544 X-Git-Tag: v1_8_2_01~1^2~251 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e14ae584f4f16361c8dcae161189e3ddee781e4d;p=fs%2Flustre-release.git b=19544 i=Robert Read i=Dmitry Zogin move to static on-stack allocations --- diff --git a/lustre/lvfs/lustre_quota_fmt.c b/lustre/lvfs/lustre_quota_fmt.c index 8e0f68c..be5680c 100644 --- a/lustre/lvfs/lustre_quota_fmt.c +++ b/lustre/lvfs/lustre_quota_fmt.c @@ -585,7 +585,7 @@ static int lustre_write_dquot(struct lustre_dquot *dquot, loff_t offset; ssize_t ret; int dqblk_sz = lustre_disk_dqblk_sz[version]; - char ddquot[dqblk_sz]; + char ddquot[sizeof(union lustre_disk_dqblk_un)]; ret = mem2diskdqb(ddquot, &dquot->dq_dqb, dquot->dq_id, version); if (ret < 0) @@ -836,7 +836,7 @@ int lustre_read_dquot(struct lustre_dquot *dquot) memset(&dquot->dq_dqb, 0, sizeof(struct lustre_mem_dqblk)); ret = offset; } else { - char ddquot[dqblk_sz]; + char ddquot[sizeof(union lustre_disk_dqblk_un)]; dquot->dq_off = offset; fs = get_fs(); diff --git a/lustre/lvfs/lustre_quota_fmt.h b/lustre/lvfs/lustre_quota_fmt.h index ab43160..434c24f 100644 --- a/lustre/lvfs/lustre_quota_fmt.h +++ b/lustre/lvfs/lustre_quota_fmt.h @@ -123,6 +123,11 @@ struct lustre_disk_dqblk_v2 { #define GETENTRIES(buf,version) ((version == LUSTRE_QUOTA_V1) ? \ GETENTRIES_V1(buf) : GETENTRIES_V2(buf)) +union lustre_disk_dqblk_un { + struct lustre_disk_dqblk v1; + struct lustre_disk_dqblk_v2 v2; +}; + /* * Here are header structures as written on disk and their in-memory copies */