Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2012 Red Hat, Inc.
0003  *
0004  * This file is released under the GPL.
0005  */
0006 
0007 #ifndef DM_CACHE_BLOCK_TYPES_H
0008 #define DM_CACHE_BLOCK_TYPES_H
0009 
0010 #include "persistent-data/dm-block-manager.h"
0011 
0012 /*----------------------------------------------------------------*/
0013 
0014 /*
0015  * It's helpful to get sparse to differentiate between indexes into the
0016  * origin device, indexes into the cache device, and indexes into the
0017  * discard bitset.
0018  */
0019 
0020 typedef dm_block_t __bitwise dm_oblock_t;
0021 typedef uint32_t __bitwise dm_cblock_t;
0022 typedef dm_block_t __bitwise dm_dblock_t;
0023 
0024 static inline dm_oblock_t to_oblock(dm_block_t b)
0025 {
0026     return (__force dm_oblock_t) b;
0027 }
0028 
0029 static inline dm_block_t from_oblock(dm_oblock_t b)
0030 {
0031     return (__force dm_block_t) b;
0032 }
0033 
0034 static inline dm_cblock_t to_cblock(uint32_t b)
0035 {
0036     return (__force dm_cblock_t) b;
0037 }
0038 
0039 static inline uint32_t from_cblock(dm_cblock_t b)
0040 {
0041     return (__force uint32_t) b;
0042 }
0043 
0044 static inline dm_dblock_t to_dblock(dm_block_t b)
0045 {
0046     return (__force dm_dblock_t) b;
0047 }
0048 
0049 static inline dm_block_t from_dblock(dm_dblock_t b)
0050 {
0051     return (__force dm_block_t) b;
0052 }
0053 
0054 #endif /* DM_CACHE_BLOCK_TYPES_H */