#include <linux/list.h>
#include <linux/spinlock.h>
+#include <linux/rcupdate.h>
#define _VX_INFO_DEF_
#include "cvirt.h"
#undef _VX_INFO_DEF_
struct vx_info {
- struct list_head vx_list; /* linked list of contexts */
+ struct hlist_node vx_hlist; /* linked list of contexts */
+ struct rcu_head vx_rcu; /* the rcu head */
xid_t vx_id; /* context id */
- atomic_t vx_refcount; /* refcount */
+ atomic_t vx_usecnt; /* usage count */
+ atomic_t vx_refcnt; /* reference count */
struct vx_info *vx_parent; /* parent context */
struct namespace *vx_namespace; /* private namespace */
};
-extern spinlock_t vxlist_lock;
-extern struct list_head vx_infos;
-
-
#define VX_ADMIN 0x0001
#define VX_WATCH 0x0002
#define VX_DUMMY 0x0008
#define VX_ATR_MASK 0x0F00
-void free_vx_info(struct vx_info *);
+extern void rcu_free_vx_info(struct rcu_head *);
+extern void unhash_vx_info(struct vx_info *);
+
+extern struct vx_info *locate_vx_info(int);
+extern struct vx_info *locate_or_create_vx_info(int);
-extern struct vx_info *find_vx_info(int);
-extern struct vx_info *find_or_create_vx_info(int);
-extern int vx_info_id_valid(int);
+extern int get_xid_list(int, unsigned int *, int);
+extern int vx_info_is_hashed(xid_t);
extern int vx_migrate_task(struct task_struct *, struct vx_info *);
#define VXF_STATE_INIT (1ULL<<33)
#define VXF_FORK_RSS (1ULL<<48)
+#define VXF_PROLIFIC (1ULL<<49)
#define VXF_ONE_TIME (0x0003ULL<<32)
#define VXC_SET_UTSNAME 0x00000001
#define VXC_SET_RLIMIT 0x00000002
-#define VXC_ICMP_PING 0x00000100
+#define VXC_RAW_ICMP 0x00000100
#define VXC_SECURE_MOUNT 0x00010000