i=Robert Read
i=Dmitry Zogin
move to static on-stack allocations
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)
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();
#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
*/