Subject: Re: linux-next: build failure after merge of the akpm tree

From: Andrew Morton <[email-masked]>
Date: Mon, 1 Oct 2012 12:56:19 -0700

On Fri, 28 Sep 2012 11:19:29 -0400 (EDT)
Mikulas Patocka <[email-masked]> wrote:

> > -	if (!prio_tree_empty(&mapping->i_mmap) ||
> > +	if (!RB_EMPTY_ROOT(&mapping->i_mmap) ||
> >  	    !list_empty(&mapping->i_mmap_nonlinear)) {
> >  		mutex_unlock(&mapping->i_mmap_mutex);
> >  		percpu_up_write(&bdev->bd_block_size_semaphore);
> > -- 
> > 1.7.10.280.gaa39
> > 
> > -- 
> > Cheers,
> > Stephen Rothwell                    [email-masked]
> 
> ... or replace it with
> 
> if (mapping_mapped(&mapping)) { ...

yup..

From: Andrew Morton <[email-masked]>
Subject: fs/block_dev.c:set_blocksize(): use mapping_mapped()

... instead of open-coding it.

Suggested-by: Mikulas Patocka <[email-masked]>
Cc: Stephen Rothwell <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 fs/block_dev.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN fs/block_dev.c~fs-block_devc-set_blocksize-use-mapping_mapped fs/block_dev.c
--- a/fs/block_dev.c~fs-block_devc-set_blocksize-use-mapping_mapped
+++ a/fs/block_dev.c
@@ -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 *b
 	/* 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;
_