OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] diskquota: 32bit quota tools on 64bit architectures
Re: [PATCH] diskquota: 32bit quota tools on 64bit architectures [message #7781 is a reply to message #7778] Wed, 25 October 2006 11:03 Go to previous messageGo to previous message
Arnd Bergmann is currently offline  Arnd Bergmann
Messages: 10
Registered: February 2006
Junior Member
On Wednesday 25 October 2006 12:03, Vasily Tarasov wrote:
> + * This code works only for 32 bit quota tools over 64 bit OS (x86_64, ia64)
> + * and is necessary due to alignment problems.
> + */
> +struct compat_if_dqblk {
> +       compat_uint_t dqb_bhardlimit[2];
> +       compat_uint_t dqb_bsoftlimit[2];
> +       compat_uint_t dqb_curspace[2];
> +       compat_uint_t dqb_ihardlimit[2];
> +       compat_uint_t dqb_isoftlimit[2];
> +       compat_uint_t dqb_curinodes[2];
> +       compat_uint_t dqb_btime[2];
> +       compat_uint_t dqb_itime[2];
> +       compat_uint_t dqb_valid;
> +};
> +
> +/* XFS structures */
> +struct compat_fs_qfilestat {
> +       compat_uint_t dqb_bhardlimit[2];
> +       compat_uint_t   qfs_nblks[2];
> +       compat_uint_t   qfs_nextents;
> +};
> +

The patch looks technically correct, but you have defined the structures
in a somewhat unusual way. I'd have defined them with
attribute((packed, aligned(4))) in the end.

Or even better, we should probably add a

typedef unsigned long long __attribute__((aligned(4))) compat_u64;

for x86 compat and use that instead of compat_uint_t foo[2].

Arnd <><
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: communicating between host and VPS
Next Topic: [PATCH] Fix ipc entries removal
Goto Forum:
  


Current Time: Sat Aug 02 03:44:17 GMT 2025

Total time taken to generate the page: 1.10669 seconds