All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: Tony Breeds <tony@bakeyournoodle.com>
Cc: xen-devel <xen-devel@lists.xensource.com>, julian@xensource.com
Subject: Re: [PATCH] don't use PAGE_SIZE in userspace
Date: Tue, 19 Dec 2006 20:36:29 -0700	[thread overview]
Message-ID: <1166585789.5054.8.camel@bling> (raw)
In-Reply-To: <20061220032645.GB27551@bakeyournoodle.com>

On Wed, 2006-12-20 at 14:26 +1100, Tony Breeds wrote:
> On Tue, Dec 19, 2006 at 07:48:03PM -0700, Alex Williamson wrote:
> > 
> >    PAGE_SIZE is not a constant on all architectures, getpagesize()
> > should be used from userspace.  Thanks,
> >  
> >  	/*adjust file length to 4 KByte boundary*/
> > -	length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),PAGE_SIZE);
> > +	length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),
> > +		getpagesize());
> 
> How about updateing the comment above, aswell?

   Oops, fixed.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

diff -r 381f119b15a0 tools/blktap/drivers/block-qcow.c
--- a/tools/blktap/drivers/block-qcow.c	Tue Dec 19 21:33:12 2006 +0000
+++ b/tools/blktap/drivers/block-qcow.c	Tue Dec 19 20:34:11 2006 -0700
@@ -1352,8 +1352,9 @@ int qcow_create(const char *filename, ui
 	printf("Created cksum: %d\n",exthdr.cksum);
 	free(ptr);
 
-	/*adjust file length to 4 KByte boundary*/
-	length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),PAGE_SIZE);
+	/*adjust file length to system page size boundary*/
+	length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),
+		getpagesize());
 	if (qtruncate(fd, length, 0)!=0) {
 		DPRINTF("ERROR truncating file\n");
 		return -1;

      reply	other threads:[~2006-12-20  3:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20  2:48 [PATCH] don't use PAGE_SIZE in userspace Alex Williamson
2006-12-20  3:26 ` Tony Breeds
2006-12-20  3:36   ` Alex Williamson [this message]

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=1166585789.5054.8.camel@bling \
    --to=alex.williamson@hp.com \
    --cc=julian@xensource.com \
    --cc=tony@bakeyournoodle.com \
    --cc=xen-devel@lists.xensource.com \
    /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.