return order;
}
-#define container_of(ptr, type, member) ({ \
+#define _ust_container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
#ifndef KCOMPAT_SIMPLE_H
#define KCOMPAT_SIMPLE_H
-/**
- * container_of - cast a member of a structure out to the containing structure
- * @ptr: the pointer to the member.
- * @type: the type of the container struct this is embedded in.
- * @member: the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
-
/* libkcompat: from rcupdate.h */
struct rcu_head {
static void ust_buffers_destroy_channel(struct kref *kref)
{
- struct ust_channel *chan = container_of(kref, struct ust_channel, kref);
+ struct ust_channel *chan = _ust_container_of(kref, struct ust_channel, kref);
free(chan);
}
/* called from kref_put */
static void ust_buffers_remove_buf(struct kref *kref)
{
- struct ust_buffer *buf = container_of(kref, struct ust_buffer, kref);
+ struct ust_buffer *buf = _ust_container_of(kref, struct ust_buffer, kref);
ust_buffers_destroy_buf(buf);
}
static void ltt_relay_release_channel(struct kref *kref)
{
- struct ust_channel *ltt_chan = container_of(kref,
+ struct ust_channel *ltt_chan = _ust_container_of(kref,
struct ust_channel, kref);
free(ltt_chan->buf);
}
*/
static void release_channel_setting(struct kref *kref)
{
- struct ltt_channel_setting *setting = container_of(kref,
+ struct ltt_channel_setting *setting = _ust_container_of(kref,
struct ltt_channel_setting, kref);
struct ltt_channel_setting *iter;
static void free_old_closure(struct rcu_head *head)
{
- struct marker_entry *entry = container_of(head,
+ struct marker_entry *entry = _ust_container_of(head,
struct marker_entry, rcu);
free(entry->oldptr);
/* Make sure we free the data before setting the pending flag to 0 */
static inline void release_probes(void *old)
{
if (old) {
- struct tp_probes *tp_probes = container_of(old,
+ struct tp_probes *tp_probes = _ust_container_of(old,
struct tp_probes, probes[0]);
//ust// call_rcu_sched(&tp_probes->u.rcu, rcu_free_old_probes);
synchronize_rcu();
{
need_update = 1;
if (old) {
- struct tp_probes *tp_probes = container_of(old,
+ struct tp_probes *tp_probes = _ust_container_of(old,
struct tp_probes, probes[0]);
list_add(&tp_probes->u.list, &old_probes);
}
*/
void ltt_release_trace(struct kref *kref)
{
- struct ust_trace *trace = container_of(kref,
+ struct ust_trace *trace = _ust_container_of(kref,
struct ust_trace, kref);
ltt_channels_trace_free(trace->channels);
free(trace);