harsh97 / compcache

Automatically exported from code.google.com/p/compcache
1 stars 0 forks source link

QUEUE_FLAG_NONPROT not defined problem on SuSE Linux 11.1 (2.6.27.7) #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Linux meriadoc 2.6.27.7-9-default #1 SMP 2008-12-04 18:10:04 +0100 i686 
i686 i386 GNU/Linux

  CC [M]  /home/neko/compcache-0.5.1/compcache.o
/home/neko/compcache-0.5.1/compcache.c: In function ‘compcache_init’:
/home/neko/compcache-0.5.1/compcache.c:455: error: ‘QUEUE_FLAG_NONROT’ 
undeclared (first use in this function)
/home/neko/compcache-0.5.1/compcache.c:455: error: (Each undeclared 
identifier is reported only once
/home/neko/compcache-0.5.1/compcache.c:455: error: for each function it 
appears in.)
make[4]: *** [/home/neko/compcache-0.5.1/compcache.o] Error 1
make[3]: *** [_module_/home/neko/compcache-0.5.1] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27.7-9-obj/i386/default'
make: *** [all] Error 2

In compcache.c line 455 QUEUE_FLAG_NONROT is used to inform the block 
subsystem that there is no seek cost on the virtual swap disk, however 
while the functions to support swap discard are present in the kernel, this 
flag came in just after SuSE finalized their kernel patches for this 
release, so isn't present.

The use of QUEUE_FLAG_NONROT should be covered by a 

#ifdef QUEUE_FLAG_NONROT
      queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue);
#endif

In order that swap discard support can be compiled and used. I found 
absolutely no problems in adding this little fix, compcache works great :)

Original issue reported on code.google.com by webmaste...@gtempaccount.com on 28 Jan 2009 at 3:02

GoogleCodeExporter commented 9 years ago
--- compcache.c.orig    2009-01-28 12:14:22.000000000 -0600 
+++ compcache.c 2009-01-28 12:14:56.000000000 -0600 
@@ -452,7 +452,9 @@ static int __init compcache_init(void) 
        blk_queue_make_request(compcache.disk->queue, compcache_make_request); 

 #ifdef SWAP_DISCARD_SUPPORTED 
+#ifdef QUEUE_FLAG_NONROT 
        queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue); 
+#endif 
        blk_queue_set_discard(compcache.disk->queue, 
                                compcache_prepare_discard); 
 #endif 

Original comment by mwsea...@gmail.com on 28 Jan 2009 at 6:14

GoogleCodeExporter commented 9 years ago
Fixed in r276. Thanks for pointing this out!

Nitin

Original comment by nitingupta910@gmail.com on 28 Jan 2009 at 6:23