diff options
author | Jarkko Lavinen <jarkko.lavinen@nokia.com> | 2011-02-14 09:16:09 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-03-11 09:22:46 -0500 |
commit | c7519dbf6f4b4408229d279d799c938ffdd06f21 (patch) | |
tree | 77952c980c6a744b8f318a4514f30cfb26a9d4df /include/linux/mtd | |
parent | 13ce77f46c79a3839e4c2ff9722c9416c165f498 (diff) |
mtd_blkdevs: Add background processing support
Add a new background method into mtd_blktrans_ops, add background support
into mtd_blktrans_thread(), and add mtd_blktrans_cease_background().
If the mtd blktrans dev has the background support, the thread will
call background function when the request queue becomes empty. The background
operation may run as long as needs to until
mtd_blktrans_cease_background() tells to stop.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/blktrans.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 26529ebd59cc..66bec4bf2b0a 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
@@ -62,6 +62,7 @@ struct mtd_blktrans_ops { | |||
62 | unsigned long block, char *buffer); | 62 | unsigned long block, char *buffer); |
63 | int (*discard)(struct mtd_blktrans_dev *dev, | 63 | int (*discard)(struct mtd_blktrans_dev *dev, |
64 | unsigned long block, unsigned nr_blocks); | 64 | unsigned long block, unsigned nr_blocks); |
65 | void (*background)(struct mtd_blktrans_dev *dev); | ||
65 | 66 | ||
66 | /* Block layer ioctls */ | 67 | /* Block layer ioctls */ |
67 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); | 68 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); |
@@ -85,6 +86,7 @@ extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); | |||
85 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); | 86 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); |
86 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 87 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); |
87 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 88 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); |
89 | extern int mtd_blktrans_cease_background(struct mtd_blktrans_dev *dev); | ||
88 | 90 | ||
89 | 91 | ||
90 | #endif /* __MTD_TRANS_H__ */ | 92 | #endif /* __MTD_TRANS_H__ */ |