]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/sched.h
New upstream release
[bcachefs-tools-debian] / include / linux / sched.h
index c5c8e3ac10ee7fe64daab7359e85898810ccd25d..7afb6d54bb34101e3b78a9d02ce1196ffa1fbaf6 100644 (file)
@@ -107,7 +107,12 @@ extern __thread struct task_struct *current;
 #define set_current_state(state_value)                 \
        smp_store_mb(current->state, (state_value))
 
-#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
+static inline struct task_struct *get_task_struct(struct task_struct *task)
+{
+       atomic_inc(&task->usage);
+       return task;
+
+}
 
 extern void __put_task_struct(struct task_struct *t);
 
@@ -146,6 +151,14 @@ static inline u64 ktime_get_seconds(void)
        return ts.tv_sec;
 }
 
+static inline u64 ktime_get_real_ns(void)
+{
+       struct timespec ts;
+
+       clock_gettime(CLOCK_REALTIME, &ts);
+       return timespec_to_ns(&ts);
+}
+
 static inline u64 ktime_get_real_seconds(void)
 {
        struct timespec ts;