@@ -1232,24 +1232,34 @@ flashcache_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1232
1232
}
1233
1233
1234
1234
dmc -> tgt = ti ;
1235
- #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,34 )
1236
- r = dm_get_device (ti , argv [0 ], 0 , ti -> len ,
1235
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,34 )
1236
+ r = dm_get_device (ti , argv [0 ],
1237
1237
dm_table_get_mode (ti -> table ), & dmc -> disk_dev );
1238
1238
#else
1239
+ #if defined(RHEL_MAJOR ) && RHEL_MAJOR == 6
1239
1240
r = dm_get_device (ti , argv [0 ],
1240
1241
dm_table_get_mode (ti -> table ), & dmc -> disk_dev );
1242
+ #else
1243
+ r = dm_get_device (ti , argv [0 ], 0 , ti -> len ,
1244
+ dm_table_get_mode (ti -> table ), & dmc -> disk_dev );
1245
+ #endif
1241
1246
#endif
1242
1247
if (r ) {
1243
1248
ti -> error = "flashcache: Source device lookup failed" ;
1244
1249
goto bad1 ;
1245
1250
}
1246
1251
strncpy (dmc -> disk_devname , argv [0 ], DEV_PATHLEN );
1247
- #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,34 )
1248
- r = dm_get_device (ti , argv [1 ], 0 , 0 ,
1252
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,34 )
1253
+ r = dm_get_device (ti , argv [0 ] ,
1249
1254
dm_table_get_mode (ti -> table ), & dmc -> cache_dev );
1250
1255
#else
1251
- r = dm_get_device (ti , argv [1 ],
1256
+ #if defined(RHEL_MAJOR ) && RHEL_MAJOR == 6
1257
+ r = dm_get_device (ti , argv [0 ],
1258
+ dm_table_get_mode (ti -> table ), & dmc -> cache_dev );
1259
+ #else
1260
+ r = dm_get_device (ti , argv [0 ], 0 , ti -> len ,
1252
1261
dm_table_get_mode (ti -> table ), & dmc -> cache_dev );
1262
+ #endif
1253
1263
#endif
1254
1264
if (r ) {
1255
1265
ti -> error = "flashcache: Cache device lookup failed" ;
@@ -2049,6 +2059,9 @@ flashcache_init(void)
2049
2059
if (r < 0 ) {
2050
2060
DMERR ("cache: register failed %d" , r );
2051
2061
}
2062
+
2063
+ printk ("flashcache: %s initialized\n" , flashcache_sw_version );
2064
+
2052
2065
#ifdef CONFIG_PROC_FS
2053
2066
#if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,21 )
2054
2067
flashcache_table_header =
0 commit comments