wrapper: user_namespace.h: remove backward compatibility code
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 19:41:00 +0000 (15:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 19:41:00 +0000 (15:41 -0400)
wrapper/user_namespace.h

index 5e0ab5ace684cfb4af41fc6c7133c719b2616a2e..8cc6020709d7c6cd46177ae86cde1424a93ba287 100644 (file)
@@ -13,8 +13,6 @@
 #include <linux/user_namespace.h>
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
-
 #define lttng_current_xxuid(xxx)                               \
        (from_kuid_munged(&init_user_ns, current_##xxx()))
 
@@ -51,50 +49,6 @@ gid_t lttng_task_vgid(struct task_struct *p, struct user_namespace *ns)
        return gid;
 }
 
-#else
-
-#define lttng_current_xxuid(xxx)       (current_##xxx())
-
-#define lttng_current_vxxuid(xxx)                                      \
-       (user_ns_map_uid(current_user_ns(), current_cred(), current_##xxx()))
-
-#define lttng_current_xxgid(xxx)       (current_##xxx())
-
-#define lttng_current_vxxgid(xxx)                                      \
-       (user_ns_map_gid(current_user_ns(), current_cred(), current_##xxx()))
-
-static inline
-uid_t lttng_task_vuid(struct task_struct *p, struct user_namespace *ns)
-{
-       uid_t uid;
-
-       /*
-        * __task_cred requires the RCU readlock be held
-        */
-       rcu_read_lock();
-       uid = user_ns_map_uid(ns, __task_cred(p), __task_cred(p)->uid);
-       rcu_read_unlock();
-
-       return uid;
-}
-
-static inline
-gid_t lttng_task_vgid(struct task_struct *p, struct user_namespace *ns)
-{
-       gid_t gid;
-
-       /*
-        * __task_cred requires the RCU readlock be held
-        */
-       rcu_read_lock();
-       gid = user_ns_map_gid(ns, __task_cred(p), __task_cred(p)->gid);
-       rcu_read_unlock();
-
-       return gid;
-}
-
-#endif
-
 #define lttng_current_uid()    (lttng_current_xxuid(uid))
 #define lttng_current_euid()   (lttng_current_xxuid(euid))
 #define lttng_current_suid()   (lttng_current_xxuid(suid))
This page took 0.027026 seconds and 4 git commands to generate.