summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2009-06-11 09:55:26 +0000
committerluigi <luigi@FreeBSD.org>2009-06-11 09:55:26 +0000
commit39676e4ab432d3a8127aa1cf32f00f5fed51c6b0 (patch)
tree6b14985cd3ab66c96dc7e48867c3a445738966c9 /sys/geom/geom.h
parentf62faa022463a57f0265698b7af9ad62f465f417 (diff)
downloadFreeBSD-src-39676e4ab432d3a8127aa1cf32f00f5fed51c6b0.zip
FreeBSD-src-39676e4ab432d3a8127aa1cf32f00f5fed51c6b0.tar.gz
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.
Diffstat (limited to 'sys/geom/geom.h')
-rw-r--r--sys/geom/geom.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index a916ec5..c89083f 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -195,6 +195,17 @@ struct g_provider {
u_int index;
};
+/*
+ * Descriptor of a classifier. We can register a function and
+ * an argument, which is called by g_io_request() on bio's
+ * that are not previously classified.
+ */
+struct g_classifier_hook {
+ TAILQ_ENTRY(g_classifier_hook) link;
+ int (*func)(void *arg, struct bio *bp);
+ void *arg;
+};
+
/* geom_dev.c */
struct cdev;
void g_dev_print(void);
@@ -272,6 +283,8 @@ void g_destroy_bio(struct bio *);
void g_io_deliver(struct bio *bp, int error);
int g_io_getattr(const char *attr, struct g_consumer *cp, int *len, void *ptr);
int g_io_flush(struct g_consumer *cp);
+int g_register_classifier(struct g_classifier_hook *hook);
+void g_unregister_classifier(struct g_classifier_hook *hook);
void g_io_request(struct bio *bp, struct g_consumer *cp);
struct bio *g_new_bio(void);
struct bio *g_alloc_bio(void);
OpenPOWER on IntegriCloud