[osol-mktg] Re: [Fwd: ZFS code snippet]

Tim Foster Tim.Foster at sun.com
Thu May 4 07:46:23 PDT 2006


Cool, in that case, it gets my vote.

On Thu, 2006-05-04 at 09:14 -0500, Sara Dornsife wrote:
> Bill and Jeff like the zio read.
> 
> We have a time crunch for JavaOne, can we get a quick vote on
> replacing the DTrace code in the background of the fan buttons for the
> anniversary stuff with the ZFS code?
> Sara
> 
> 
> Tim Foster wrote: 
> > On Wed, 2006-05-03 at 10:26 -0700, Dan Price wrote: 
> >   
> > > On Wed 03 May 2006 at 11:32AM, Sara Dornsife wrote:
> > >     
> > > > Here's some code from ZFS - is this enough, or do you need more ? It's
> > > > not quite the one Dan mentioned, but close (from 
> > > > http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/fs/zfs/zio.c#306
> > > > )
> > > >       
> > > This is good too.  What I liked about the code I mentioned is that it's
> > > a core part of the way ZFS "self heals" bad data.  But make sure to ask
> > > Jeff/Bill for his input.
> > >     
> > 
> > Mm, you're right, but is it art ? ;-) Plain aesthetics really were
> > mostly the only reason I tried for something else - the mixture of upper
> > and lower case code looked a bit more pleasing to my highly untrained
> > eye (oh, and I like the sentiment of using zio, being a bit fundamental)
> > 
> > Och anyway - both are attached here, either are fine by me really, I
> > don't care that much ...
> > 
> > Of course, the *ultimate* thing to do here, would be to produce a
> > limited run of "originals", each OpenSolaris t-shirt being unique, with
> > a different snippet of code on each one, with the most recent code
> > submitter of that snippet having their signature embossed in gold leaf
> > on the bottom left of the logo, uh wait - I'm getting carried away
> > here...
> > 
> > it's just a t-shirt :-)
> > 
> > 	cheers,
> > 		tim
> > 
> >   
> > 
> > ____________________________________________________________________
> > 
> > zio_t * zio_read(zio_t *pio, spa_t *spa, blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *private, int priority, int flags, zbookmark_t *zb) { zio_t *zio; ASSERT3U(size, ==, BP_GET_LSIZE(bp)); zio = zio_create(pio, spa, bp->blk_birth, bp, data, size, done, private, ZIO_TYPE_READ, priority, flags, ZIO_STAGE_OPEN, ZIO_READ_PIPELINE); zio->io_bookmark = *zb; zio->io_logical = zio; /* * Work off our copy of the bp so the caller can free it.  */ zio->io_bp = &zio->io_bp_copy; if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF) { uint64_t csize = BP_GET_PSIZE(bp); void *cbuf = zio_buf_alloc(csize); zio_push_transform(zio, cbuf, csize, csize); zio->io_pipeline |= 1U << ZIO_STAGE_READ_DECOMPRESS; } if (BP_IS_GANG(bp)) { uint64_t gsize = SPA_GANGBLOCKSIZE; void *gbuf = zio_buf_alloc(gsize); zio_push_transform(zio, gbuf, gsize, gsize); zio->io_pipeline |= 1U << ZIO_STAGE_READ_GANG_MEMBERS; } return (zio); }
> >   
> > 
> > ____________________________________________________________________
> > 
> > /* * We know the data's good.  If we read the parity, * verify that it's good as well.  If not, fix it.  */ for (c = 0; c < rm->rm_firstdatacol; c++) { void *orig; rc = &rm->rm_col[c]; if (!rc->rc_tried) continue; orig = zio_buf_alloc(rc->rc_size); bcopy(rc->rc_data, orig, rc->rc_size); vdev_raidz_reconstruct(rm, c); if (bcmp(orig, rc->rc_data, rc->rc_size) != 0) { raidz_checksum_error(zio, rc); rc->rc_error = ECKSUM; unexpected_errors++; } zio_buf_free(orig, rc->rc_size); } goto done;
> >   
> > 
> > ____________________________________________________________________
> > 
> > _______________________________________________
> > opensolaris-mktg mailing list
> > opensolaris-mktg at opensolaris.org
> >   
> 
> _______________________________________________
> opensolaris-mktg mailing list
> opensolaris-mktg at opensolaris.org
-- 
Tim Foster, Sun Microsystems Inc, Operating Platforms Group
Engineering Operations            http://blogs.sun.com/timf

_______________________________________________
opensolaris-mktg mailing list
opensolaris-mktg at opensolaris.org



More information about the opensolaris-mktg mailing list