compatmac.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:16k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * mtd/include/compatmac.h
  3.  *
  4.  * $Id: compatmac.h,v 1.36 2002/03/11 16:43:33 dwmw2 Exp $
  5.  *
  6.  * Extensions and omissions from the normal 'linux/compatmac.h'
  7.  * files. hopefully this will end up empty as the 'real' one 
  8.  * becomes fully-featured.
  9.  */
  10. /* First, include the parts which the kernel is good enough to provide 
  11.  * to us 
  12.  */
  13.    
  14. #ifndef __LINUX_MTD_COMPATMAC_H__
  15. #define __LINUX_MTD_COMPATMAC_H__
  16. #include <linux/config.h>
  17. #include <linux/module.h>
  18. #ifndef LINUX_VERSION_CODE
  19. #include <linux/version.h>
  20. #endif
  21. #ifndef VERSION_CODE
  22. #  define VERSION_CODE(vers,rel,seq) ( ((vers)<<16) | ((rel)<<8) | (seq) )
  23. #endif
  24. #ifndef KERNEL_VERSION
  25. #  define KERNEL_VERSION(a,b,c) VERSION_CODE(a,b,c)
  26. #endif
  27. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0)
  28. #  error "This kernel is too old: not supported by this file"
  29. #endif
  30. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
  31. #include <linux/types.h> /* used later in this header */
  32. #define memcpy_fromio(a,b,c)    memcpy((a),(void *)(b),(c))
  33. #define memcpy_toio(a,b,c)      memcpy((void *)(a),(b),(c))
  34. typedef struct wait_queue * wait_queue_head_t;
  35. #define DECLARE_WAITQUEUE(x,y) struct wait_queue x = {y,NULL}
  36. #define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x = NULL
  37. #define init_waitqueue_head init_waitqueue
  38. #define DECLARE_MUTEX(x) struct semaphore x = MUTEX
  39. #define DECLARE_MUTEX_LOCKED(x) struct semaphore x = MUTEX_LOCKED
  40. /* from sysdep-2.1.h */
  41. #  include <asm/segment.h>
  42. #  define access_ok(t,a,sz)           (verify_area((t),(a),(sz)) ? 0 : 1)
  43. #  define verify_area_20              verify_area
  44. #  define copy_to_user(t,f,n)         (memcpy_tofs(t,f,n), 0)
  45. #  define __copy_to_user(t,f,n)       copy_to_user((t),(f),(n))
  46. #  define copy_to_user_ret(t,f,n,r)   copy_to_user((t),(f),(n))
  47. #  define copy_from_user(t,f,n)       (memcpy_fromfs((t),(f),(n)), 0)
  48. #  define __copy_from_user(t,f,n)     copy_from_user((t),(f),(n))
  49. #  define copy_from_user_ret(t,f,n,r) copy_from_user((t),(f),(n))
  50. //xxx #  define PUT_USER(val,add)           (put_user((val),(add)), 0)
  51. #  define Put_user(val,add)           (put_user((val),(add)), 0)
  52. #  define __PUT_USER(val,add)         PUT_USER((val),(add))
  53. #  define PUT_USER_RET(val,add,ret)   PUT_USER((val),(add))
  54. #  define GET_USER(dest,add)          ((dest)=get_user((add)), 0)
  55. #  define __GET_USER(dest,add)        GET_USER((dest),(add))
  56. #  define GET_USER_RET(dest,add,ret)  GET_USER((dest),(add))
  57. #define ioremap(offset,size) vremap(offset,size)
  58. #define iounmap(adr) /* */
  59. #define EXPORT_SYMBOL(s) /* */
  60. #define EXPORT_SYMBOL_NOVERS(s) /* */
  61. /* 2.1.10 and 2.1.43 introduced new functions. They are worth using */
  62. #if LINUX_VERSION_CODE < VERSION_CODE(2,1,10)
  63. #  include <asm/byteorder.h>
  64. #  ifdef __LITTLE_ENDIAN
  65. #    define cpu_to_le16(x) (x)
  66. #    define cpu_to_le32(x) (x)
  67. #    define cpu_to_be16(x) htons((x))
  68. #    define cpu_to_be32(x) htonl((x))
  69. #  else
  70. #    define cpu_to_be16(x) (x)
  71. #    define cpu_to_be32(x) (x)
  72.      extern inline __u16 cpu_to_le16(__u16 x) { return (x<<8) | (x>>8);}
  73.      extern inline __u32 cpu_to_le32(__u32 x) { return((x>>24) |
  74.              ((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24));}
  75. #  endif
  76. #  define le16_to_cpu(x)  cpu_to_le16(x)
  77. #  define le32_to_cpu(x)  cpu_to_le32(x)
  78. #  define be16_to_cpu(x)  cpu_to_be16(x)
  79. #  define be32_to_cpu(x)  cpu_to_be32(x)
  80. #endif
  81. #if LINUX_VERSION_CODE < VERSION_CODE(2,1,43)
  82. #  define cpu_to_le16p(addr) (cpu_to_le16(*(addr)))
  83. #  define cpu_to_le32p(addr) (cpu_to_le32(*(addr)))
  84. #  define cpu_to_be16p(addr) (cpu_to_be16(*(addr)))
  85. #  define cpu_to_be32p(addr) (cpu_to_be32(*(addr)))
  86.    extern inline void cpu_to_le16s(__u16 *a) {*a = cpu_to_le16(*a);}
  87.    extern inline void cpu_to_le32s(__u16 *a) {*a = cpu_to_le32(*a);}
  88.    extern inline void cpu_to_be16s(__u16 *a) {*a = cpu_to_be16(*a);}
  89.    extern inline void cpu_to_be32s(__u16 *a) {*a = cpu_to_be32(*a);}
  90. #  define le16_to_cpup(x) cpu_to_le16p(x)
  91. #  define le32_to_cpup(x) cpu_to_le32p(x)
  92. #  define be16_to_cpup(x) cpu_to_be16p(x)
  93. #  define be32_to_cpup(x) cpu_to_be32p(x)
  94. #  define le16_to_cpus(x) cpu_to_le16s(x)
  95. #  define le32_to_cpus(x) cpu_to_le32s(x)
  96. #  define be16_to_cpus(x) cpu_to_be16s(x)
  97. #  define be32_to_cpus(x) cpu_to_be32s(x)
  98. #endif
  99. // from 2.2, linux/types.h
  100. #ifndef __BIT_TYPES_DEFINED__
  101. #define __BIT_TYPES_DEFINED__
  102. typedef         __u8            u_int8_t;
  103. typedef         __s8            int8_t;
  104. typedef         __u16           u_int16_t;
  105. typedef         __s16           int16_t;
  106. typedef         __u32           u_int32_t;
  107. typedef         __s32           int32_t;
  108. #endif /* !(__BIT_TYPES_DEFINED__) */
  109. #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
  110.   typedef struct { } spinlock_t;
  111.   #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
  112. #else
  113.   typedef struct { int gcc_is_buggy; } spinlock_t;
  114.   #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
  115. #endif
  116. #define spin_lock_init(lock)    do { } while(0)
  117. #define spin_lock(lock)         (void)(lock) /* Not "unused variable". */
  118. #define spin_trylock(lock)      (1)
  119. #define spin_unlock_wait(lock)  do { } while(0)
  120. #define spin_unlock(lock)       do { } while(0)
  121. #define spin_lock_irq(lock)     cli()
  122. #define spin_unlock_irq(lock)   sti()
  123. #define spin_lock_irqsave(lock, flags) 
  124.         do { save_flags(flags); cli(); } while (0)
  125. #define spin_unlock_irqrestore(lock, flags) 
  126.         restore_flags(flags)
  127. // Doesn't work when tqueue.h is included. 
  128. // #define queue_task                   queue_task_irq_off
  129. #define tty_flip_buffer_push(tty)    queue_task_irq_off(&tty->flip.tqueue, &tq_timer)
  130. #define signal_pending(current)      (current->signal & ~current->blocked)
  131. #define schedule_timeout(to)         do {current->timeout = jiffies + (to);schedule ();} while (0)
  132. #define time_after(t1,t2)            (((long)t1-t2) > 0)
  133. #else
  134.   #include <linux/compatmac.h>
  135. #endif  // LINUX_VERSION_CODE < 0x020100
  136. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
  137. #include <linux/vmalloc.h>
  138. #endif
  139. /* Modularization issues */
  140. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,18)
  141. #  define __USE_OLD_SYMTAB__
  142. #  define EXPORT_NO_SYMBOLS register_symtab(NULL);
  143. #  define REGISTER_SYMTAB(tab) register_symtab(tab)
  144. #else
  145. #  define REGISTER_SYMTAB(tab) /* nothing */
  146. #endif
  147. #ifdef __USE_OLD_SYMTAB__
  148. #  define __MODULE_STRING(s)         /* nothing */
  149. #  define MODULE_PARM(v,t)           /* nothing */
  150. #  define MODULE_PARM_DESC(v,t)      /* nothing */
  151. #  define MODULE_AUTHOR(n)           /* nothing */
  152. #  define MODULE_DESCRIPTION(d)      /* nothing */
  153. #  define MODULE_SUPPORTED_DEVICE(n) /* nothing */
  154. #endif
  155. /*
  156.  * "select" changed in 2.1.23. The implementation is twin, but this
  157.  * header is new
  158.  */
  159. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,22)
  160. #  include <linux/poll.h>
  161. #else
  162. #  define __USE_OLD_SELECT__
  163. #endif
  164. /* Other change in the fops are solved using pseudo-types */
  165. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
  166. #  define lseek_t      long long
  167. #  define lseek_off_t  long long
  168. #else
  169. #  define lseek_t      int
  170. #  define lseek_off_t  off_t
  171. #endif
  172. /* changed the prototype of read/write */
  173. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0) || defined(__alpha__)
  174. # define count_t unsigned long
  175. # define read_write_t long
  176. #else
  177. # define count_t int
  178. # define read_write_t int
  179. #endif
  180. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,31)
  181. # define release_t void
  182. #  define release_return(x) return
  183. #else
  184. #  define release_t int
  185. #  define release_return(x) return (x)
  186. #endif
  187. #if LINUX_VERSION_CODE < 0x20300
  188. #define __exit
  189. #endif
  190. #if LINUX_VERSION_CODE < 0x20200
  191. #define __init
  192. #else
  193. #include <linux/init.h>
  194. #endif
  195. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
  196. #define init_MUTEX(x) do {*(x) = MUTEX;} while (0)
  197. #define init_MUTEX_LOCKED(x) do {*(x) = MUTEX_LOCKED;} while (0)
  198. #endif
  199. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
  200. #define RQFUNC_ARG void
  201. #define blkdev_dequeue_request(req) do {CURRENT = req->next;} while (0)
  202. #else
  203. #define RQFUNC_ARG request_queue_t *q
  204. #endif
  205. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,32)
  206. #define blk_cleanup_queue(nr) do {blk_dev[nr].request_fn = 0;} while(0)
  207. #define BLK_DEFAULT_QUEUE(nr) (blk_dev[nr].request_fn)
  208. #define blk_init_queue(q, rq) do {q = rq;} while(0)
  209. #endif
  210. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
  211. #ifdef CONFIG_MODULES
  212. #define __MOD_INC_USE_COUNT(mod)                                        
  213.         (atomic_inc(&(mod)->uc.usecount), (mod)->flags |= MOD_VISITED|MOD_USED_ONCE)
  214. #define __MOD_DEC_USE_COUNT(mod)                                        
  215.         (atomic_dec(&(mod)->uc.usecount), (mod)->flags |= MOD_VISITED)
  216. #else
  217. #define __MOD_INC_USE_COUNT(mod)
  218. #define __MOD_DEC_USE_COUNT(mod)
  219. #endif
  220. #endif
  221. #ifndef HAVE_INTER_MODULE
  222. static inline void *inter_module_get(char *x) {return NULL;}
  223. static inline void *inter_module_get_request(char *x, char *y) {return NULL;}
  224. static inline void inter_module_put(const char *x) {}
  225. static inline void inter_module_register(const char *x, struct module *y, const void *z) {}
  226. static inline void inter_module_unregister(const char *x) {}
  227. #endif
  228. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
  229. #define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x = NULL
  230. #define init_waitqueue_head init_waitqueue
  231. #endif
  232. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
  233. static inline int try_inc_mod_count(struct module *mod)
  234. {
  235. #ifdef CONFIG_MODULES
  236. if (mod)
  237. __MOD_INC_USE_COUNT(mod);
  238. #endif
  239. return 1;
  240. }
  241. #endif
  242. /* Yes, I'm aware that it's a fairly ugly hack.
  243.    Until the __constant_* macros appear in Linus' own kernels, this is
  244.    the way it has to be done.
  245.  DW 19/1/00
  246.  */
  247. #include <asm/byteorder.h>
  248. #ifndef __constant_cpu_to_le16
  249. #ifdef __BIG_ENDIAN
  250. #define __constant_cpu_to_le64(x) ___swab64((x))
  251. #define __constant_le64_to_cpu(x) ___swab64((x))
  252. #define __constant_cpu_to_le32(x) ___swab32((x))
  253. #define __constant_le32_to_cpu(x) ___swab32((x))
  254. #define __constant_cpu_to_le16(x) ___swab16((x))
  255. #define __constant_le16_to_cpu(x) ___swab16((x))
  256. #define __constant_cpu_to_be64(x) ((__u64)(x))
  257. #define __constant_be64_to_cpu(x) ((__u64)(x))
  258. #define __constant_cpu_to_be32(x) ((__u32)(x))
  259. #define __constant_be32_to_cpu(x) ((__u32)(x))
  260. #define __constant_cpu_to_be16(x) ((__u16)(x))
  261. #define __constant_be16_to_cpu(x) ((__u16)(x))
  262. #else
  263. #ifdef __LITTLE_ENDIAN
  264. #define __constant_cpu_to_le64(x) ((__u64)(x))
  265. #define __constant_le64_to_cpu(x) ((__u64)(x))
  266. #define __constant_cpu_to_le32(x) ((__u32)(x))
  267. #define __constant_le32_to_cpu(x) ((__u32)(x))
  268. #define __constant_cpu_to_le16(x) ((__u16)(x))
  269. #define __constant_le16_to_cpu(x) ((__u16)(x))
  270. #define __constant_cpu_to_be64(x) ___swab64((x))
  271. #define __constant_be64_to_cpu(x) ___swab64((x))
  272. #define __constant_cpu_to_be32(x) ___swab32((x))
  273. #define __constant_be32_to_cpu(x) ___swab32((x))
  274. #define __constant_cpu_to_be16(x) ___swab16((x))
  275. #define __constant_be16_to_cpu(x) ___swab16((x))
  276. #else
  277. #error No (recognised) endianness defined (unless it,s PDP)
  278. #endif /* __LITTLE_ENDIAN */
  279. #endif /* __BIG_ENDIAN */
  280. #endif /* ifndef __constant_cpu_to_le16 */
  281. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
  282.   #define mod_init_t int  __init
  283.   #define mod_exit_t void  
  284. #else
  285.   #define mod_init_t static int __init
  286.   #define mod_exit_t static void __exit
  287. #endif
  288. #ifndef THIS_MODULE
  289. #ifdef MODULE
  290. #define THIS_MODULE (&__this_module)
  291. #else
  292. #define THIS_MODULE (NULL)
  293. #endif
  294. #endif
  295. #if LINUX_VERSION_CODE < 0x20300
  296. #include <linux/interrupt.h>
  297. #define spin_lock_bh(lock) do {start_bh_atomic();spin_lock(lock);}while(0)
  298. #define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();}while(0)
  299. #else
  300. #include <asm/softirq.h>
  301. #include <linux/spinlock.h>
  302. #endif
  303. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
  304. #define set_current_state(state_value)                        
  305.         do { current->state = (state_value); } while (0)
  306. #endif
  307. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) 
  308. static inline int invalidate_device(kdev_t dev, int do_sync) {
  309. if (do_sync)
  310. fsync_dev(dev);
  311. invalidate_buffers(dev);
  312. return 0;
  313. }
  314. #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5)
  315. static inline int invalidate_device(kdev_t dev, int do_sync) {
  316. struct super_block *sb = get_super(dev);
  317. int res = 0;
  318. if (do_sync)
  319. fsync_dev(dev);
  320. if (sb)
  321. res = invalidate_inodes(sb);
  322. invalidate_buffers(dev);
  323. return res;
  324. }
  325. #endif
  326. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
  327. #undef min
  328. #undef max
  329. #undef min_t
  330. #undef max_t
  331. /*
  332.  * min()/max() macros that also do
  333.  * strict type-checking.. See the
  334.  * "unnecessary" pointer comparison.
  335.  */
  336. #define min(x,y) ({ 
  337.         const typeof(x) _x = (x);       
  338.         const typeof(y) _y = (y);       
  339.         (void) (&_x == &_y);            
  340.         _x < _y ? _x : _y; })
  341. #define max(x,y) ({ 
  342.         const typeof(x) _x = (x);       
  343.         const typeof(y) _y = (y);       
  344.         (void) (&_x == &_y);            
  345.         _x > _y ? _x : _y; })
  346. /*
  347.  * ..and if you can't take the strict
  348.  * types, you can specify one yourself.
  349.  *
  350.  * Or not use min/max at all, of course.
  351.  */
  352. #define min_t(type,x,y) 
  353.         ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
  354. #define max_t(type,x,y) 
  355.         ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
  356. #endif
  357. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,7)
  358. struct completion {
  359. struct semaphore s;
  360. };
  361. #define complete(c) up(&(c)->s)
  362. #define wait_for_completion(c) down(&(c)->s)
  363. #define init_completion(c) init_MUTEX_LOCKED(&(c)->s);
  364. #endif
  365. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9)
  366. /* This came later */
  367. #define complete_and_exit(c, r) do { complete(c); do_exit(r); } while(0)
  368. #endif
  369. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9) || 
  370.     (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10) && !defined(__rh_config_h__))
  371. #include <linux/genhd.h>
  372. static inline void add_gendisk(struct gendisk *gp)
  373. {
  374. gp->next = gendisk_head;
  375. gendisk_head = gp;
  376. }
  377. static inline void del_gendisk(struct gendisk *gp)
  378. {
  379. struct gendisk *gd, **gdp;
  380. for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next))
  381. if (*gdp == gp) {
  382. gd = *gdp; *gdp = gd->next;
  383. break;
  384. }
  385. }
  386. #endif
  387. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) && defined(MODULE)
  388. #define module_init(func)
  389. mod_init_t init_module(void) {
  390. return func();
  391. }
  392. #define module_exit(func)
  393. mod_exit_t cleanup_module(void) {
  394. return func();
  395. }
  396. #endif
  397. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9) || 
  398.     (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10) && !defined(__rh_config_h__))
  399. #define MODULE_LICENSE(x) /* */
  400. #endif
  401. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,5)
  402. #include <linux/sched.h>
  403. static inline void __recalc_sigpending(void)
  404. {
  405. recalc_sigpending(current);
  406. }
  407. #define recalc_sigpending() __recalc_sigpending ()
  408. #endif
  409. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,5)
  410. #define parent_ino(d) ((d)->d_parent->d_inode->i_ino)
  411. #endif
  412. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3)
  413. #define need_resched() (current->need_resched)
  414. #define cond_resched() do { if need_resched() schedule(); } while(0)
  415. #endif
  416. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
  417. #define yield() do { current->policy |= SCHED_YIELD; schedule(); } while(0)
  418. #define mk_kdev(ma,mi) MKDEV(ma,mi)
  419. #define kdev_t_to_nr(x) (x)
  420. #endif
  421. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
  422. #define major(d) (MAJOR(to_kdev_t(d)))
  423. #define minor(d) (MINOR(to_kdev_t(d)))
  424. #endif
  425. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
  426. /* Is this right? */
  427. #define set_user_nice(tsk, n) do { (tsk)->priority = 20-(n); } while(0) 
  428. #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
  429. #define set_user_nice(tsk, n) do { (tsk)->nice = n; } while(0)
  430. #endif
  431. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
  432. #define rq_data_dir(x) ((x)->cmd)
  433. #define IS_REQ_CMD(req) (1)
  434. #define QUEUE_LOCK(q) (&io_request_lock)
  435. #define BLK_INIT_QUEUE(q, req, lock) blk_init_queue((q), (req)) 
  436. #else /* > 2.5.0 */
  437. #define IS_REQ_CMD(req) ((req)->flags & REQ_CMD)
  438. #define QUEUE_LOCK(q) ((q)->queue_lock)
  439. #define BLK_INIT_QUEUE(q, req, lock) blk_init_queue((q), (req), (lock)) 
  440. #endif
  441. /* Removed cos it broke stuff. Where is this required anyway? 
  442.  * #ifndef QUEUE_EMPTY
  443.  * #define QUEUE_EMPTY  (!CURRENT)
  444.  * #endif
  445.  */
  446. #if LINUX_VERSION_CODE < 0x20300
  447. #define QUEUE_PLUGGED (blk_dev[MAJOR_NR].plug_tq.sync)
  448. #elif LINUX_VERSION_CODE < 0x20500 //FIXME (Si)
  449. #define QUEUE_PLUGGED (blk_dev[MAJOR_NR].request_queue.plugged)
  450. #else
  451. #define QUEUE_PLUGGED (blk_queue_plugged(QUEUE))
  452. #endif
  453. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,14)
  454. #define BLK_INC_USE_COUNT MOD_INC_USE_COUNT
  455. #define BLK_DEC_USE_COUNT MOD_DEC_USE_COUNT
  456. #else
  457. #define BLK_INC_USE_COUNT do {} while(0)
  458. #define BLK_DEC_USE_COUNT do {} while(0)
  459. #endif
  460. #endif /* __LINUX_MTD_COMPATMAC_H__ */