diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 11:59:12 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:34 -0500 |
| commit | b0a31f7b2a668f00a8d0546dfeed65fac871b2da (patch) | |
| tree | 7379a66d9bfd6ae067f090f1bebac5d47332f5cb /include/linux | |
| parent | 4403dbfb4541d34e5db33db709094d57d09f7467 (diff) | |
mtd: introduce mtd_writev interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mtd/mtd.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index b58e5e8746ec..4129cb5c3de4 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -204,18 +204,14 @@ struct mtd_info { | |||
| 204 | size_t *retlen, u_char *buf); | 204 | size_t *retlen, u_char *buf); |
| 205 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, | 205 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
| 206 | size_t len); | 206 | size_t len); |
| 207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, | ||
| 208 | unsigned long count, loff_t to, size_t *retlen); | ||
| 207 | 209 | ||
| 208 | /* Backing device capabilities for this device | 210 | /* Backing device capabilities for this device |
| 209 | * - provides mmap capabilities | 211 | * - provides mmap capabilities |
| 210 | */ | 212 | */ |
| 211 | struct backing_dev_info *backing_dev_info; | 213 | struct backing_dev_info *backing_dev_info; |
| 212 | 214 | ||
| 213 | /* kvec-based read/write methods. | ||
| 214 | NB: The 'count' parameter is the number of _vectors_, each of | ||
| 215 | which contains an (ofs, len) tuple. | ||
| 216 | */ | ||
| 217 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); | ||
| 218 | |||
| 219 | /* Sync */ | 215 | /* Sync */ |
| 220 | void (*sync) (struct mtd_info *mtd); | 216 | void (*sync) (struct mtd_info *mtd); |
| 221 | 217 | ||
| @@ -375,6 +371,16 @@ static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, | |||
| 375 | return mtd->lock_user_prot_reg(mtd, from, len); | 371 | return mtd->lock_user_prot_reg(mtd, from, len); |
| 376 | } | 372 | } |
| 377 | 373 | ||
| 374 | /* | ||
| 375 | * kvec-based read/write method. NB: The 'count' parameter is the number of | ||
| 376 | * _vectors_, each of which contains an (ofs, len) tuple. | ||
| 377 | */ | ||
| 378 | static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | ||
| 379 | unsigned long count, loff_t to, size_t *retlen) | ||
| 380 | { | ||
| 381 | return mtd->writev(mtd, vecs, count, to, retlen); | ||
| 382 | } | ||
| 383 | |||
| 378 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 384 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 379 | { | 385 | { |
| 380 | return dev ? dev_get_drvdata(dev) : NULL; | 386 | return dev ? dev_get_drvdata(dev) : NULL; |
