iommu/amd: Apply the same IVRS IOAPIC workaround to Acer Aspire A315-41
[linux-2.6-block.git] / kernel / pid.c
index 16263b5265604dd7931d4431920d51b633429050..0a9f2e437217655daf18aaba0e57b30096595371 100644 (file)
 #include <linux/init_task.h>
 #include <linux/syscalls.h>
 #include <linux/proc_ns.h>
-#include <linux/proc_fs.h>
+#include <linux/refcount.h>
 #include <linux/anon_inodes.h>
 #include <linux/sched/signal.h>
 #include <linux/sched/task.h>
 #include <linux/idr.h>
 
 struct pid init_struct_pid = {
-       .count          = ATOMIC_INIT(1),
+       .count          = REFCOUNT_INIT(1),
        .tasks          = {
                { .first = NULL },
                { .first = NULL },
@@ -108,8 +108,7 @@ void put_pid(struct pid *pid)
                return;
 
        ns = pid->numbers[pid->level].ns;
-       if ((atomic_read(&pid->count) == 1) ||
-            atomic_dec_and_test(&pid->count)) {
+       if (refcount_dec_and_test(&pid->count)) {
                kmem_cache_free(ns->pid_cachep, pid);
                put_pid_ns(ns);
        }
@@ -212,7 +211,7 @@ struct pid *alloc_pid(struct pid_namespace *ns)
        }
 
        get_pid_ns(ns);
-       atomic_set(&pid->count, 1);
+       refcount_set(&pid->count, 1);
        for (type = 0; type < PIDTYPE_MAX; ++type)
                INIT_HLIST_HEAD(&pid->tasks[type]);