mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
mtd: mtdblock: call mtd_sync() only if opened for write
Because it is useless to call it if the device is opened in R/O mode, and also harmful: on CFI NOR flash it may block for long time waiting for erase operations to complete is another partition with a R/W file-system on this chip. Artem Bityutskiy: write commit message, amend the patch to match the latest tree (we use mtd_sync(), not mtd->sync() nowadays). Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
2ff5e1532d
commit
70d5098a4b
3 changed files with 8 additions and 2 deletions
|
@ -47,6 +47,7 @@ struct mtd_blktrans_dev {
|
|||
struct request_queue *rq;
|
||||
spinlock_t queue_lock;
|
||||
void *priv;
|
||||
fmode_t file_mode;
|
||||
};
|
||||
|
||||
struct mtd_blktrans_ops {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue