From: David Gibson <david@gibson.dropbear.id.au>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH 2/3] Allow larger return values from get_image_size()
Date: Sat, 25 Feb 2012 09:08:54 +1100 [thread overview]
Message-ID: <20120224220854.GA3433@truffala.fritz.box> (raw)
In-Reply-To: <4F475547.1020102@suse.de>
On Fri, Feb 24, 2012 at 10:15:51AM +0100, Andreas Färber wrote:
> Am 24.02.2012 01:36, schrieb David Gibson:
> > Currently get_image_size(), used to find the size of files, returns an int.
> > But for modern systems, int may be only 32-bit and we can have files
> > larger than that.
> >
> > This patch, therefore, changes the return type of get_image_size() to off_t
> > (the same as the return type from lseek() itself). It also audits all the
> > callers of get_image_size() to make sure they process the new unsigned
> > return type correctly.
>
> It's a size, so why off_t and not size_t?
Because it's a file size, rather than an in-memory size. Or more
specifically, off_t is the return type of lseek() which is where the
information is coming from in the first place.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2012-02-24 22:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 0:36 [Qemu-devel] [0/3] Various code cleanups David Gibson
2012-02-24 0:36 ` [Qemu-devel] [PATCH 1/3] pci: Factor out bounds checking on config space accesses David Gibson
2012-02-24 0:36 ` [Qemu-devel] [PATCH 2/3] Allow larger return values from get_image_size() David Gibson
2012-02-24 0:48 ` Michael S. Tsirkin
2012-02-24 9:15 ` Andreas Färber
2012-02-24 22:08 ` David Gibson [this message]
2012-02-27 8:21 ` Markus Armbruster
2012-02-27 8:27 ` David Gibson
2012-02-27 9:31 ` Markus Armbruster
2012-02-24 0:36 ` [Qemu-devel] [PATCH 3/3] .gitignore update David Gibson
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=20120224220854.GA3433@truffala.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).