|
@@ -59,11 +59,20 @@ struct map_groups {
|
|
|
struct rb_root maps[MAP__NR_TYPES];
|
|
|
struct list_head removed_maps[MAP__NR_TYPES];
|
|
|
struct machine *machine;
|
|
|
+ int refcnt;
|
|
|
};
|
|
|
|
|
|
struct map_groups *map_groups__new(void);
|
|
|
void map_groups__delete(struct map_groups *mg);
|
|
|
|
|
|
+static inline struct map_groups *map_groups__get(struct map_groups *mg)
|
|
|
+{
|
|
|
+ ++mg->refcnt;
|
|
|
+ return mg;
|
|
|
+}
|
|
|
+
|
|
|
+void map_groups__put(struct map_groups *mg);
|
|
|
+
|
|
|
static inline struct kmap *map__kmap(struct map *map)
|
|
|
{
|
|
|
return (struct kmap *)(map + 1);
|