Re: [Bcache v13 11/16] bcache: Core btree code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-05-09 at 23:10 -0400, Kent Overstreet wrote:
> Signed-off-by: Kent Overstreet <koverstreet@xxxxxxxxxx>
[]
> +
> +void btree_read_done(struct closure *cl)
> +{
[]
> +	if (b->written < btree_blocks(b))
> +		bset_init_next(b);
> +
> +	if (0) {
> +err:		set_btree_node_io_error(b);
> +		cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys",
> +				err, PTR_BUCKET_NR(b->c, &b->key, 0),
> +				index(i, b), i->keys);
> +	}

Hi Kent

trivia:  This if (0) is an exceedingly ugly style.

I'd much prefer:

	if (foo)
		bar();

	goto exit;

err:
	set_btree_node_io_error(b);
	cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys",
			err, PTR_BUCKET_NR(b->c, &b->key, 0),
			index(i, b), i->keys);

exit:
	etc...


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux