]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/block_dev.c:set_blocksize(): use mapping_mapped()
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 2 Oct 2012 06:03:10 +0000 (16:03 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:01:45 +0000 (14:01 +1000)
... instead of open-coding it.

Suggested-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/block_dev.c

index 165b01f1b314c2078bd6d7eee1050487e1491452..785aa3b372e05e409f545ebbc1cc3f17091bdb02 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/namei.h>
 #include <linux/log2.h>
 #include <linux/cleancache.h>
-#include <linux/rbtree.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
@@ -133,8 +132,7 @@ int set_blocksize(struct block_device *bdev, int size)
        /* Check that the block device is not memory mapped */
        mapping = bdev->bd_inode->i_mapping;
        mutex_lock(&mapping->i_mmap_mutex);
-       if (!RB_EMPTY_ROOT(&mapping->i_mmap) ||
-           !list_empty(&mapping->i_mmap_nonlinear)) {
+       if (mapping_mapped(mapping)) {
                mutex_unlock(&mapping->i_mmap_mutex);
                percpu_up_write(&bdev->bd_block_size_semaphore);
                return -EBUSY;