[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] sheepdog: add data preallocation support
From: |
MORITA Kazutaka |
Subject: |
Re: [Qemu-devel] [PATCH] sheepdog: add data preallocation support |
Date: |
Mon, 23 May 2011 20:13:44 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/22.3 (x86_64-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Mon, 23 May 2011 10:19:13 +0100,
Stefan Hajnoczi wrote:
>
> On Sat, May 21, 2011 at 1:35 PM, MORITA Kazutaka
> <address@hidden> wrote:
> > +static int sd_prealloc(uint32_t vid, int64_t vdi_size)
> > +{
> > + int fd, ret;
> > + SheepdogInode *inode;
> > + char *buf;
> > + unsigned long idx, max_idx;
> [...]
> > + max_idx = (vdi_size + SD_DATA_OBJ_SIZE - 1) / SD_DATA_OBJ_SIZE;
> > +
> > + for (idx = 0; idx < max_idx; idx++) {
>
> Do you want to use uint64_t here instead of unsigned long, which may
> be too small on 32-bit hosts?
The index of a Sheepdog data object is within 32-bit range, so using
an unsigned long is safe here.
Thanks,
Kazutaka