Subject: [PATCH] device-mapper: fix for bio API change
From: Stephen Rothwell <[email-masked]>
Date: Wed, 30 Jun 2010 12:54:22 +1000

Hi Alasdair,

After merging the device-mapper tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

drivers/md/dm.c: In function '__clone_and_map':
/data/sfr/next/drivers/md/dm.c:1245: error: implicit declaration of function 'bio_rw_flagged'
/data/sfr/next/drivers/md/dm.c:1245: error: 'BIO_RW_DISCARD' undeclared (first use in this function)

Caused by commit d134095c1564b101987d8f2920d0928cae669be2
("dm-linear-support-discard") interacting with commit
74450be123b6f3cb480c358a056be398cce6aa6e ("block: unify flags for struct
bio and struct request") from the block tree.

I hate API changes :-)

I applied the following merge fix up patch:

Signed-off-by: Stephen Rothwell <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>
---
 drivers/md/dm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[AGK: Fold into preceding patch prior to upstream submission.]

Index: linux-2.6.35/drivers/md/dm.c
===================================================================
--- linux-2.6.35.orig/drivers/md/dm.c
+++ linux-2.6.35/drivers/md/dm.c
@@ -1268,7 +1268,7 @@ static int __clone_and_map(struct clone_
 	if (unlikely(bio_empty_barrier(bio)))
 		return __clone_and_map_empty_barrier(ci);
 
-	if (unlikely(bio_rw_flagged(bio, BIO_RW_DISCARD)))
+	if (unlikely(bio->bi_rw & REQ_DISCARD))
 		return __clone_and_map_discard(ci);
 
 	ti = dm_table_find_target(ci->map, ci->sector);