From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH 08/13] get&put chan&chan_buf's reference
Date: Thu, 15 Jan 2009 14:23:30 -0500 [thread overview]
Message-ID: <20090115192330.GH32620@Krystal> (raw)
In-Reply-To: <496C5A41.6040908@cn.fujitsu.com>
* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
>
> these 4 APIs is for get and put struct rchan or struct chan_buf's
> reference.
>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
> ---
> b/ltt/ltt-relay-alloc.c | 12 ++++++++++++
> include/linux/ltt-relay.h | 12 ++++++++++++
> 2 files changed, 24 insertions(+)
> diff --git a/include/linux/ltt-relay.h b/include/linux/ltt-relay.h
> index 1225a6a..173b557 100644
> --- a/include/linux/ltt-relay.h
> +++ b/include/linux/ltt-relay.h
> @@ -170,6 +173,18 @@ struct rchan *ltt_relay_open(const char *base_filename,
> void *private_data);
> extern void ltt_relay_close(struct rchan *chan);
>
> +static inline void ltt_relay_get_chan(struct rchan *chan)
> +{
> + kref_get(&chan->kref);
> +}
> +void ltt_relay_put_chan(struct rchan *chan);
> +
> +static inline void ltt_relay_get_chan_buf(struct rchan_buf *buf)
> +{
> + kref_get(&buf->kref);
> +}
> +void ltt_relay_put_chan_buf(struct rchan_buf *buf);
> +
> /*
> * exported ltt_relay file operations, ltt/ltt-relay-alloc.c
> */
> diff --git a/ltt/ltt-relay-alloc.c b/ltt/ltt-relay-alloc.c
> index 80e856c..4d9489d 100644
> --- a/ltt/ltt-relay-alloc.c
> +++ b/ltt/ltt-relay-alloc.c
> @@ -116,6 +116,12 @@ static void relay_destroy_channel(struct kref *kref)
> kfree(chan);
> }
>
> +void ltt_relay_put_chan(struct rchan *chan)
> +{
> + kref_put(&chan->kref, relay_destroy_channel);
> +}
> +EXPORT_SYMBOL_GPL(ltt_relay_put_chan);
> +
> /**
> * relay_destroy_buf - destroy an rchan_buf struct and associated buffer
> * @buf: the buffer struct
> @@ -150,6 +156,12 @@ static void relay_remove_buf(struct kref *kref)
> relay_destroy_buf(buf);
> }
>
> +void ltt_relay_put_chan_buf(struct rchan_buf *buf)
> +{
> + kref_put(&buf->kref, relay_remove_buf);
> +}
> +EXPORT_SYMBOL_GPL(ltt_relay_put_chan_buf);
> +
> /*
> * High-level relay kernel API and associated functions.
> */
>
>
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
prev parent reply other threads:[~2009-01-15 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 9:09 Lai Jiangshan
2009-01-15 19:23 ` Mathieu Desnoyers [this message]
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=20090115192330.GH32620@Krystal \
--to=compudj@krystal.dyndns.org \
/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