From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>,
Claudio Fontana <claudio.fontana@huawei.com>,
qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: Allow getdents to be provided by getdents64
Date: Mon, 03 Jun 2013 08:15:31 -0700 [thread overview]
Message-ID: <51ACB313.60007@twiddle.net> (raw)
In-Reply-To: <1370193044-24535-1-git-send-email-peter.maydell@linaro.org>
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~
next prev parent reply other threads:[~2013-06-03 15:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-02 17:10 [Qemu-devel] [PATCH] linux-user: Allow getdents to be provided by getdents64 Peter Maydell
2013-06-03 15:15 ` Richard Henderson [this message]
2013-06-03 15:45 ` Peter Maydell
2013-06-03 15:58 ` Richard Henderson
2013-06-03 16:17 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2013-06-03 11:11 Laurent Vivier
2013-06-03 11:28 ` Peter Maydell
2013-06-03 11:50 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51ACB313.60007@twiddle.net \
--to=rth@twiddle.net \
--cc=claudio.fontana@huawei.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.