diff options
author | Gu Zheng <guz.fnst@cn.fujitsu.com> | 2014-12-02 21:19:52 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-01-07 15:51:56 -0500 |
commit | 362376a7c65936835f39ff29b082a646d522efbc (patch) | |
tree | 572f5ca2d9d560e265a31f198b5c8ef2e6810553 | |
parent | 0b56d2d45e7c27581ca90f36b4317373f23e7622 (diff) |
mtd: mtdblock: remove the needless mtdblks_lock
The global lock mtdblks_lock was used to protect the original mtdblks
array to avoid race conditions. As the mtdblks array was already gone,
but the mtdblks_lock is left, and it causes latency when open/release dev.
So we need to remove it here.
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/mtdblock.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index 485ea751c7f9..bb4c14f83c75 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c | |||
@@ -45,8 +45,6 @@ struct mtdblk_dev { | |||
45 | enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state; | 45 | enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static DEFINE_MUTEX(mtdblks_lock); | ||
49 | |||
50 | /* | 48 | /* |
51 | * Cache stuff... | 49 | * Cache stuff... |
52 | * | 50 | * |
@@ -286,10 +284,8 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd) | |||
286 | 284 | ||
287 | pr_debug("mtdblock_open\n"); | 285 | pr_debug("mtdblock_open\n"); |
288 | 286 | ||
289 | mutex_lock(&mtdblks_lock); | ||
290 | if (mtdblk->count) { | 287 | if (mtdblk->count) { |
291 | mtdblk->count++; | 288 | mtdblk->count++; |
292 | mutex_unlock(&mtdblks_lock); | ||
293 | return 0; | 289 | return 0; |
294 | } | 290 | } |
295 | 291 | ||
@@ -302,8 +298,6 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd) | |||
302 | mtdblk->cache_data = NULL; | 298 | mtdblk->cache_data = NULL; |
303 | } | 299 | } |
304 | 300 | ||
305 | mutex_unlock(&mtdblks_lock); | ||
306 | |||
307 | pr_debug("ok\n"); | 301 | pr_debug("ok\n"); |
308 | 302 | ||
309 | return 0; | 303 | return 0; |
@@ -315,8 +309,6 @@ static void mtdblock_release(struct mtd_blktrans_dev *mbd) | |||
315 | 309 | ||
316 | pr_debug("mtdblock_release\n"); | 310 | pr_debug("mtdblock_release\n"); |
317 | 311 | ||
318 | mutex_lock(&mtdblks_lock); | ||
319 | |||
320 | mutex_lock(&mtdblk->cache_mutex); | 312 | mutex_lock(&mtdblk->cache_mutex); |
321 | write_cached_data(mtdblk); | 313 | write_cached_data(mtdblk); |
322 | mutex_unlock(&mtdblk->cache_mutex); | 314 | mutex_unlock(&mtdblk->cache_mutex); |
@@ -331,8 +323,6 @@ static void mtdblock_release(struct mtd_blktrans_dev *mbd) | |||
331 | vfree(mtdblk->cache_data); | 323 | vfree(mtdblk->cache_data); |
332 | } | 324 | } |
333 | 325 | ||
334 | mutex_unlock(&mtdblks_lock); | ||
335 | |||
336 | pr_debug("ok\n"); | 326 | pr_debug("ok\n"); |
337 | } | 327 | } |
338 | 328 | ||