4 #include <linux/vserver/tag.h>
8 #define DX_ADMIN 0x0001
9 #define DX_WATCH 0x0002
10 #define DX_HOSTID 0x0008
12 #define DX_IDENT 0x0010
14 #define DX_ARG_MASK 0x0010
17 #define dx_task_tag(t) ((t)->xid)
19 #define dx_current_tag() dx_task_tag(current)
21 #define dx_check(c,m) __dx_check(dx_current_tag(),c,m)
23 #define dx_weak_check(c,m) ((m) ? dx_check(c,m) : 1)
27 * check current context for ADMIN/WATCH and
28 * optionally against supplied argument
30 static inline int __dx_check(tag_t cid, tag_t id, unsigned int mode)
32 if (mode & DX_ARG_MASK) {
33 if ((mode & DX_IDENT) &&
37 return (((mode & DX_ADMIN) && (cid == 0)) ||
38 ((mode & DX_WATCH) && (cid == 1)) ||
39 ((mode & DX_HOSTID) && (id == 0)));
43 #warning duplicate inclusion