svn commit: r193981 - in head/sys: geom sys

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jun 11 10:06:56 UTC 2009


On Thu, Jun 11, 2009 at 09:55:27AM +0000, Luigi Rizzo wrote:
> Author: luigi
> Date: Thu Jun 11 09:55:26 2009
> New Revision: 193981
> URL: http://svn.freebsd.org/changeset/base/193981
> 
> Log:
>   As discussed in the devsummit, introduce two fields in the
>   struct bio to store classification information, and a hook
>   for classifier functions that can be called by g_io_request().
>   
>   This code is from Fabio Checconi as part of his GSOC work.
[...]
> +int
> +g_register_classifier(struct g_classifier_hook *hook)
> +{
> +
> +	g_bioq_lock(&g_bio_run_down);
> +	TAILQ_INSERT_TAIL(&g_classifier_tailq, hook, link);
> +	g_bioq_unlock(&g_bio_run_down);
> +
> +	return (0);
> +}

Why not to make it void, just like g_unregister_classifier()?

> +void
> +g_unregister_classifier(struct g_classifier_hook *hook)
> +{
> +	struct g_classifier_hook *entry;
> +
> +	g_bioq_lock(&g_bio_run_down);
> +	TAILQ_FOREACH(entry, &g_classifier_tailq, link) {
> +		if (entry == hook) {
> +			TAILQ_REMOVE(&g_classifier_tailq, hook, link);
> +			break;
> +		}
> +	}
> +	g_bioq_unlock(&g_bio_run_down);
> +}

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090611/feb15ea4/attachment.pgp


More information about the svn-src-head mailing list