Skip to contentSkip to conversation

-tip: block, mm: Fix build error in mm/memcontrol.c

PATCH Ingo Molnar 2 participants 3 messages Jul 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Today's upstream tree build (x86, 64-bit, allyesconfig) failed with this build error:

mm/memcontrol.c: In function ‘mem_cgroup_force_empty’:
mm/memcontrol.c:1976: error: ‘BLK_RW_ASYNC’ undeclared (first use in this function) mm/memcontrol.c:1976: error: (Each undeclared identifier is reported only once mm/memcontrol.c:1976: error: for each function it appears in.)

Due to commit:

8aa7e84: Fix congestion_wait() sync/async vs read/write confusion

Missing to include a required header file for the BLK_RW_ASYNC.

---
 mm/memcontrol.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
mm/memcontrol.c +1 -0
index e2fa20d..708103d 100644
@@ -25,6 +25,7 @@
 #include <linux/smp.h>
 #include <linux/page-flags.h>
 #include <linux/backing-dev.h>
+#include <linux/blkdev.h>
 #include <linux/bit_spinlock.h>
 #include <linux/rcupdate.h>
 #include <linux/limits.h>
#1 lore raw
Quoted 3 lines · Ingo Molnar

Today's upstream tree build (x86, 64-bit, allyesconfig) failed with this build error:

I merged a better fix from Trond, which should make all of this unnecessary (just move BLK_RW_[A]SYNC to the header file that people need anyway).

Linus

#2 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Ingo Molnar

Today's upstream tree build (x86, 64-bit, allyesconfig) failed with this build error:

I merged a better fix from Trond, which should make all of this unnecessary (just move BLK_RW_[A]SYNC to the header file that people need anyway).

ok, that's better. I think if in addition to that we also did what i suggested:

Quoted 5 lines

Fix it the simplest way for now, by moving the definitions early in blkdev.h (this cannot break anything), but the real fix would be to split up blkdev.h into blkdev-types.h and blkdev-api.h and make only the API definitions/declarations dependent on CONFIG_BLOCK.

would be one step cleaner.

We could then include blkdev-types.h in backing-dev.h so that it picks up the constants. Right now having BLK_RW_[A]SYNC in backing-dev.h looks a bit weird. No strong opinion though.

Ingo