Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/sched/g_sched.h
Show All 24 Lines | |||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#ifndef _G_SCHED_H_ | #ifndef _G_SCHED_H_ | ||||
#define _G_SCHED_H_ | #define _G_SCHED_H_ | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
/* | /* | ||||
* $Id$ | * $Id$ | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
* | * | ||||
* Header for the geom_sched class (userland library and kernel part). | * Header for the geom_sched class (userland library and kernel part). | ||||
* See g_sched.c for documentation. | * See g_sched.c for documentation. | ||||
* The userland code only needs the three G_SCHED_* values below. | * The userland code only needs the three G_SCHED_* values below. | ||||
*/ | */ | ||||
#define G_SCHED_CLASS_NAME "SCHED" | #define G_SCHED_CLASS_NAME "SCHED" | ||||
#define G_SCHED_VERSION 0 | #define G_SCHED_VERSION 0 | ||||
#define G_SCHED_SUFFIX ".sched." | #define G_SCHED_SUFFIX ".sched." | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define G_SCHED_DEBUG(lvl, ...) do { \ | #define G_SCHED_DEBUG(lvl, ...) \ | ||||
if (me.gs_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_SCHED", me.gs_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_SCHED"); \ | #define G_SCHED_LOGREQ(bp, ...) \ | ||||
if (me.gs_debug > 0) \ | _GEOM_DEBUG("GEOM_SCHED", me.gs_debug, 2, (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_SCHED_LOGREQ(bp, ...) do { \ | |||||
if (me.gs_debug >= 2) { \ | |||||
printf("GEOM_SCHED[2]: "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
LIST_HEAD(g_hash, g_sched_class); | LIST_HEAD(g_hash, g_sched_class); | ||||
/* | /* | ||||
* Descriptor of a scheduler. | * Descriptor of a scheduler. | ||||
* In addition to the obvious fields, sc_flushing and sc_pending | * In addition to the obvious fields, sc_flushing and sc_pending | ||||
* support dynamic switching of scheduling algorithm. | * support dynamic switching of scheduling algorithm. | ||||
* Normally, sc_flushing is 0, and requests that are scheduled are | * Normally, sc_flushing is 0, and requests that are scheduled are | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |