diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2012-11-10 13:08:20 -0300 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-11-21 17:02:23 +0200 |
commit | 22a8578fca5a47e643bb4f70c232d0ec84db9e4e (patch) | |
tree | fbc9ae9a7e723c971ce397984a7c22d1d2cf671a /include/linux/mtd | |
parent | 9329c5eb5b087d6e6af905bd7e4f7eee13f9f7e5 (diff) | |
download | linux-22a8578fca5a47e643bb4f70c232d0ec84db9e4e.tar.gz linux-22a8578fca5a47e643bb4f70c232d0ec84db9e4e.tar.bz2 linux-22a8578fca5a47e643bb4f70c232d0ec84db9e4e.zip |
mtd: mtd_blkdevs: Replace request handler kthread with a workqueue
By replacing a kthread with a workqueue, the code is now a bit clearer.
There's also a slight reduction of code size (numbers apply for x86):
Before:
text data bss dec hex filename
3248 36 0 3284 cd4 drivers/mtd/mtd_blkdevs.o
After:
text data bss dec hex filename
3150 36 0 3186 c72 drivers/mtd/mtd_blkdevs.o
Due to lack of real hardware, tests have been performed on an emulated
environment with mtdswap and mtdblock over nandsim devices.
Some real testing should be done, before merging this patch.
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/blktrans.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index ed270bd2e4df..4eb0a50d0c55 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h @@ -23,6 +23,7 @@ #include <linux/mutex.h> #include <linux/kref.h> #include <linux/sysfs.h> +#include <linux/workqueue.h> struct hd_geometry; struct mtd_info; @@ -43,7 +44,8 @@ struct mtd_blktrans_dev { struct kref ref; struct gendisk *disk; struct attribute_group *disk_attributes; - struct task_struct *thread; + struct workqueue_struct *wq; + struct work_struct work; struct request_queue *rq; spinlock_t queue_lock; void *priv; |