summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2012-01-10 13:26:58 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-27 00:11:11 +0100
commit70d5098a4b1551864dd7df43f67b7f606a1a6438 (patch)
tree288f6f9cdb1866ea9648c6590448254c40af2c81 /include
parent2ff5e1532dd37e1bd8ac72da3f7f0e2b310102fb (diff)
downloadlinux-70d5098a4b1551864dd7df43f67b7f606a1a6438.tar.gz
linux-70d5098a4b1551864dd7df43f67b7f606a1a6438.tar.bz2
linux-70d5098a4b1551864dd7df43f67b7f606a1a6438.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/blktrans.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 1bbd9f289245..ed270bd2e4df 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -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 {