|
@@ -120,18 +120,12 @@ struct io_context {
|
|
|
struct work_struct release_work;
|
|
|
};
|
|
|
|
|
|
-static inline struct io_context *ioc_task_link(struct io_context *ioc)
|
|
|
+static inline void ioc_task_link(struct io_context *ioc)
|
|
|
{
|
|
|
- /*
|
|
|
- * if ref count is zero, don't allow sharing (ioc is going away, it's
|
|
|
- * a race).
|
|
|
- */
|
|
|
- if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
|
|
|
- atomic_inc(&ioc->nr_tasks);
|
|
|
- return ioc;
|
|
|
- }
|
|
|
-
|
|
|
- return NULL;
|
|
|
+ WARN_ON_ONCE(atomic_long_read(&ioc->refcount) <= 0);
|
|
|
+ WARN_ON_ONCE(atomic_read(&ioc->nr_tasks) <= 0);
|
|
|
+ atomic_long_inc(&ioc->refcount);
|
|
|
+ atomic_inc(&ioc->nr_tasks);
|
|
|
}
|
|
|
|
|
|
struct task_struct;
|