|
@@ -251,6 +251,12 @@ static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
|
|
|
static inline void closure_queue(struct closure *cl)
|
|
|
{
|
|
|
struct workqueue_struct *wq = cl->wq;
|
|
|
+ /**
|
|
|
+ * Changes made to closure, work_struct, or a couple of other structs
|
|
|
+ * may cause work.func not pointing to the right location.
|
|
|
+ */
|
|
|
+ BUILD_BUG_ON(offsetof(struct closure, fn)
|
|
|
+ != offsetof(struct work_struct, func));
|
|
|
if (wq) {
|
|
|
INIT_WORK(&cl->work, cl->work.func);
|
|
|
BUG_ON(!queue_work(wq, &cl->work));
|