Whamcloud - gitweb
b=20722 Fix watchdog timer messages to be more clear.
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-curproc.c
index eb12dae..be37723 100644 (file)
@@ -139,23 +139,30 @@ int cfs_cap_raised(cfs_cap_t cap)
         return cap_raised(cfs_current()->cap_effective, cfs_cap_unpack(cap));
 }
 
-cfs_cap_t cfs_curproc_cap_pack(void) {
-#if _LINUX_CAPABILITY_VERSION == 0x19980330
+cfs_cap_t cfs_curproc_cap_pack(void)
+{
+#if defined (_LINUX_CAPABILITY_VERSION) && _LINUX_CAPABILITY_VERSION == 0x19980330
         return cfs_cap_pack(current->cap_effective);
-#elif _LINUX_CAPABILITY_VERSION == 0x20071026
+#elif defined (_LINUX_CAPABILITY_VERSION) && _LINUX_CAPABILITY_VERSION == 0x20071026
         return cfs_cap_pack(current->cap_effective[0]);
+#elif defined(_KERNEL_CAPABILITY_VERSION) && _KERNEL_CAPABILITY_VERSION == 0x20080522
+        /* XXX lost high byte */
+        return cfs_cap_pack(current->cap_effective.cap[0]);
 #else
-        #error "need correct _LINUX_CAPABILITY_VERSION "
+        #error "need correct _KERNEL_CAPABILITY_VERSION "
 #endif
 }
 
-void cfs_curproc_cap_unpack(cfs_cap_t cap) {
-#if _LINUX_CAPABILITY_VERSION == 0x19980330
+void cfs_curproc_cap_unpack(cfs_cap_t cap)
+{
+#if defined (_LINUX_CAPABILITY_VERSION) && _LINUX_CAPABILITY_VERSION == 0x19980330
         current->cap_effective = cfs_cap_unpack(cap);
-#elif _LINUX_CAPABILITY_VERSION == 0x20071026
+#elif defined (_LINUX_CAPABILITY_VERSION) && _LINUX_CAPABILITY_VERSION == 0x20071026
         current->cap_effective[0] = cfs_cap_unpack(cap);
+#elif defined(_KERNEL_CAPABILITY_VERSION) && _KERNEL_CAPABILITY_VERSION == 0x20080522
+        current->cap_effective.cap[0] = cfs_cap_unpack(cap);
 #else
-        #error "need correct _LINUX_CAPABILITY_VERSION "
+        #error "need correct _KERNEL_CAPABILITY_VERSION "
 #endif
 }