[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Allow getdents to be provided by ge
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Allow getdents to be provided by getdents64 |
Date: |
Mon, 03 Jun 2013 08:15:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
On 06/02/2013 10:10 AM, Peter Maydell wrote:
> + tde->d_ino = tswapal(ino);
> + tde->d_off = tswapal(off);
> + tde->d_reclen = tswap16(treclen);
> + memmove(tde->d_name, de->d_name, namelen + 1);
Wouldn't it be better to do the memmove first? Then you really are reading all
of the dirent64 data first, like your comment says.
> + /* The target_dirent type is in what was formerly a
> padding
> + * byte at the end of the structure:
> + */
> + *(((char *)tde) + treclen - 1) = type;
Maybe easier to read as
((char *)tde)[treclen - 1] = type
?
r~