1 /* ckrm-iostub.c - Stub file for ckrm_io module
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2004
5 * Latest version, more details at http://ckrm.sf.net
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
16 * 07 Aug 2004: Created
20 #include <linux/spinlock.h>
21 #include <linux/module.h>
22 #include <linux/ckrm-io.h>
24 static spinlock_t stub_lock = SPIN_LOCK_UNLOCKED;
26 static icls_tsk_t tskiclstub;
27 static icls_ioprio_t tskiopriostub;
28 static icls_tsk_t tskcfqprivstub;
30 void cki_cfq_set(icls_tsk_t tskicls, icls_ioprio_t tskioprio, icls_tsk_t tskcfqpriv)
32 spin_lock(&stub_lock);
34 tskiopriostub = tskioprio;
35 tskcfqprivstub = tskcfqpriv;
36 spin_unlock(&stub_lock);
39 void *cki_hash_key(struct task_struct *tsk)
42 spin_lock(&stub_lock);
44 ret = (*tskiclstub)(tsk);
46 ret = (void *) tsk->tgid;
47 spin_unlock(&stub_lock);
51 int cki_ioprio(struct task_struct *tsk)
54 spin_lock(&stub_lock);
56 ret = (*tskiopriostub)(tsk);
59 spin_unlock(&stub_lock);
63 void *cki_cfqpriv(struct task_struct *tsk)
66 spin_lock(&stub_lock);
68 ret = (*tskcfqprivstub)(tsk);
71 spin_unlock(&stub_lock);
75 EXPORT_SYMBOL(cki_cfq_set);
76 EXPORT_SYMBOL(cki_hash_key);
77 EXPORT_SYMBOL(cki_ioprio);
78 EXPORT_SYMBOL(cki_cfqpriv);