[sheepdog] [PATCH] sheep: add simple_store driver again

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Fri Aug 24 10:08:44 CEST 2012


At Fri, 24 Aug 2012 15:57:37 +0800,
Liu Yuan wrote:
> 
> On 08/23/2012 10:58 PM, MORITA Kazutaka wrote:
> > +static int simple_store_read_from_path(uint64_t oid, char *path,
> > +				       struct siocb *iocb)
> > +{
> > +	int flags = def_open_flags, fd, ret = SD_RES_SUCCESS;
> > +	ssize_t size;
> > +
> > +	if (!is_data_obj(oid))
> > +		flags &= ~O_DIRECT;
> > +
> > +	fd = open(path, flags);
> > +
> > +	if (fd < 0)
> > +		return err_to_sderr(oid, errno);
> > +
> > +	size = xpread(fd, iocb->buf, iocb->length, iocb->offset);
> > +	if (size != iocb->length) {
> > +		ret = SD_RES_EIO;
> > +		goto out;
> > +	}
> > +out:
> > +	close(fd);
> > +
> > +	return ret;
> > +}
> 
> Now store driver can get multiple requests to the same object, so we
> need flock for read/write as farm does, no?

I think both farm and plain don't need it.  Can you explain a scenario
where it can cause a problem?

Thanks,

Kazutaka



More information about the sheepdog mailing list