This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / linux / vs_base.h
index a1d34b6..c49e62c 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _VX_VS_BASE_H
 #define _VX_VS_BASE_H
 
-
 #include "vserver/context.h"
 
 
@@ -9,6 +8,9 @@
 
 #define vx_current_xid() vx_task_xid(current)
 
+#define current_vx_info() (current->vx_info)
+
+
 #define vx_check(c,m)  __vx_check(vx_current_xid(),c,m)
 
 #define vx_weak_check(c,m)     ((m) ? vx_check(c,m) : 1)
@@ -16,7 +18,7 @@
 
 /*
  * check current context for ADMIN/WATCH and
- * optionally agains supplied argument
+ * optionally against supplied argument
  */
 static inline int __vx_check(xid_t cid, xid_t id, unsigned int mode)
 {
@@ -98,6 +100,9 @@ static inline int __vx_check(xid_t cid, xid_t id, unsigned int mode)
        (current->vx_info && \
        (current->vx_info->vx_initpid == (n)))
 
+#define vx_capable(b,c) (capable(b) || \
+       ((current->euid == 0) && vx_ccaps(c)))
+
 
 #else
 #warning duplicate inclusion