From: Greg KH <greg@kroah.com>
To: Gerrit Huizenga <gh@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org,
Rik van Riel <riel@redhat.com>, Chris Mason <mason@suse.com>,
ckrm-tech <ckrm-tech@lists.sourceforge.net>
Subject: Re: [PATCH] CKRM: 7/10 CKRM: Resource controller for number of tasks
Date: Mon, 29 Nov 2004 15:01:48 -0800 [thread overview]
Message-ID: <20041129230148.GA20828@kroah.com> (raw)
In-Reply-To: <E1CYqbf-00059Z-00@w-gerrit.beaverton.ibm.com>
On Mon, Nov 29, 2004 at 10:50:39AM -0800, Gerrit Huizenga wrote:
> +static spinlock_t stub_lock = SPIN_LOCK_UNLOCKED;
> +
> +static get_ref_t real_get_ref = NULL;
> +static put_ref_t real_put_ref = NULL;
> +
> +void ckrm_numtasks_register(get_ref_t gr, put_ref_t pr)
> +{
> + spin_lock(&stub_lock);
> + real_get_ref = gr;
> + real_put_ref = pr;
> + spin_unlock(&stub_lock);
> +}
> +
> +int numtasks_get_ref(void *arg, int force)
> +{
> + int ret = 1;
> + spin_lock(&stub_lock);
> + if (real_get_ref) {
> + ret = (*real_get_ref) (arg, force);
> + }
> + spin_unlock(&stub_lock);
> + return ret;
> +}
> +
> +void numtasks_put_ref(void *arg)
> +{
> + spin_lock(&stub_lock);
> + if (real_put_ref) {
> + (*real_put_ref) (arg);
> + }
> + spin_unlock(&stub_lock);
> +}
> +
> +EXPORT_SYMBOL(ckrm_numtasks_register);
> +EXPORT_SYMBOL(numtasks_get_ref);
> +EXPORT_SYMBOL(numtasks_put_ref);
Why are these functions used instead of calling the real functions?
They are only ever used to register a single set of functions anyway.
Oh, and void * is to be avoided at all costs...
thanks,
greg k-h
next prev parent reply other threads:[~2004-11-29 23:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-29 18:50 Gerrit Huizenga
2004-11-29 23:01 ` Greg KH [this message]
2005-02-24 9:33 ` Gerrit Huizenga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041129230148.GA20828@kroah.com \
--to=greg@kroah.com \
--cc=akpm@osdl.org \
--cc=ckrm-tech@lists.sourceforge.net \
--cc=gh@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=riel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome