At Thu, 23 Apr 2015 19:15:00 +0800, Yu Yang wrote: > > > > > -----Original Message----- > > From: Hitoshi Mitake [mailto:mitake.hito...@gmail.com] On Behalf Of Hitoshi > > Mitake > > Sent: Thursday, April 23, 2015 5:28 PM > > To: Yu Yang > > Cc: sheepdog@lists.wpkg.org > > Subject: Re: [sheepdog] [PATCH] sheep: fix confused comments of > > vdi_snapshot() > > > > At Thu, 23 Apr 2015 16:03:49 +0800, > > Yu Yang wrote: > > > > > > From: Yu Yang <yuy...@cmss.chinamobile.com> > > > > > > fix the confused comments between snapid and vid for vdi_snapshot(). > > > > > > Signed-off-by: Yu Yang <yuy...@cmss.chinamobile.com> > > > --- > > > sheep/vdi.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/sheep/vdi.c b/sheep/vdi.c > > > index 63e578d..b35a763 100644 > > > --- a/sheep/vdi.c > > > +++ b/sheep/vdi.c > > > @@ -1572,8 +1572,8 @@ int vdi_create(const struct vdi_iocb *iocb, uint32_t > > *new_vid) > > > * 2. rollback create (base_vid != current_vid) > > > * > > > * This function expects SUCCESS returned from vdi_lookup(). Both > > > rollback > > and > > > - * snap create started with current working VDI's snap_id + 1. Working > > > VDI > > > - * always has the highest snapid. > > > + * snap creation starts with current working VDI's vid + 1. Working VDI > > > + * always has the highest vid and its snapid is 0. > > > > Sorry, I missed to point a possibility of vid overflow. Working VDI doesn't > > have the highest VID always. > > > > And the snapid of working VDI is always highest. It is simply incremented. > > > > Could you fix them? > > > > Thanks, > > Hitoshi > > > > I know when vid is overflow it's not the highest, > but you said the snapid of working VDI is always the highest ? > I find it is always ZERO, or I misunderstand of working VDI which can be > read/write ?
You can check the snapid field with $ dog vdi object dump-inode <inode object path> It will show that working VDIs have largest snapid (working VDIs have higher VIDs). # anyway, the field doesn't seem to be used currently Thanks, Hitoshi > > Thanks > Yang > > > > */ > > > int vdi_snapshot(const struct vdi_iocb *iocb, uint32_t *new_vid) > > > { > > > -- > > > 1.7.9.5 > > > > > > > > > -- > > > sheepdog mailing list > > > sheepdog@lists.wpkg.org > > > https://lists.wpkg.org/mailman/listinfo/sheepdog > > > > -- > sheepdog mailing list > sheepdog@lists.wpkg.org > https://lists.wpkg.org/mailman/listinfo/sheepdog -- sheepdog mailing list sheepdog@lists.wpkg.org https://lists.wpkg.org/mailman/listinfo/sheepdog