Whamcloud - gitweb
Add support for 64-bit bitmaps
[tools/e2fsprogs.git] / lib / ext2fs / bitops.h
1 /*
2  * bitops.h --- Bitmap frobbing code.  The byte swapping routines are
3  *      also included here.
4  *
5  * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
6  *
7  * %Begin-Header%
8  * This file may be redistributed under the terms of the GNU Public
9  * License.
10  * %End-Header%
11  *
12  * i386 bitops operations taken from <asm/bitops.h>, Copyright 1992,
13  * Linus Torvalds.
14  */
15
16
17 extern int ext2fs_set_bit(unsigned int nr,void * addr);
18 extern int ext2fs_clear_bit(unsigned int nr, void * addr);
19 extern int ext2fs_test_bit(unsigned int nr, const void * addr);
20 extern void ext2fs_fast_set_bit(unsigned int nr,void * addr);
21 extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr);
22 extern int ext2fs_set_bit64(__u64 nr,void * addr);
23 extern int ext2fs_clear_bit64(__u64 nr, void * addr);
24 extern int ext2fs_test_bit64(__u64 nr, const void * addr);
25 extern void ext2fs_fast_set_bit64(__u64 nr,void * addr);
26 extern void ext2fs_fast_clear_bit64(__u64 nr, void * addr);
27 extern __u16 ext2fs_swab16(__u16 val);
28 extern __u32 ext2fs_swab32(__u32 val);
29 extern __u64 ext2fs_swab64(__u64 val);
30
31 #ifdef WORDS_BIGENDIAN
32 #define ext2fs_cpu_to_le64(x) ext2fs_swab64((x))
33 #define ext2fs_le64_to_cpu(x) ext2fs_swab64((x))
34 #define ext2fs_cpu_to_le32(x) ext2fs_swab32((x))
35 #define ext2fs_le32_to_cpu(x) ext2fs_swab32((x))
36 #define ext2fs_cpu_to_le16(x) ext2fs_swab16((x))
37 #define ext2fs_le16_to_cpu(x) ext2fs_swab16((x))
38 #define ext2fs_cpu_to_be32(x) ((__u32)(x))
39 #define ext2fs_be32_to_cpu(x) ((__u32)(x))
40 #define ext2fs_cpu_to_be16(x) ((__u16)(x))
41 #define ext2fs_be16_to_cpu(x) ((__u16)(x))
42 #else
43 #define ext2fs_cpu_to_le64(x) ((__u64)(x))
44 #define ext2fs_le64_to_cpu(x) ((__u64)(x))
45 #define ext2fs_cpu_to_le32(x) ((__u32)(x))
46 #define ext2fs_le32_to_cpu(x) ((__u32)(x))
47 #define ext2fs_cpu_to_le16(x) ((__u16)(x))
48 #define ext2fs_le16_to_cpu(x) ((__u16)(x))
49 #define ext2fs_cpu_to_be32(x) ext2fs_swab32((x))
50 #define ext2fs_be32_to_cpu(x) ext2fs_swab32((x))
51 #define ext2fs_cpu_to_be16(x) ext2fs_swab16((x))
52 #define ext2fs_be16_to_cpu(x) ext2fs_swab16((x))
53 #endif
54
55 /*
56  * EXT2FS bitmap manipulation routines.
57  */
58
59 /* Support for sending warning messages from the inline subroutines */
60 extern const char *ext2fs_block_string;
61 extern const char *ext2fs_inode_string;
62 extern const char *ext2fs_mark_string;
63 extern const char *ext2fs_unmark_string;
64 extern const char *ext2fs_test_string;
65 extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
66                                const char *description);
67 extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
68                                 int code, unsigned long arg);
69
70 extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
71 extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
72                                        blk_t block);
73 extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
74
75 extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
76 extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
77                                        ext2_ino_t inode);
78 extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
79
80 extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
81                                           blk_t block);
82 extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
83                                             blk_t block);
84 extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
85                                          blk_t block);
86
87 extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
88                                           ext2_ino_t inode);
89 extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
90                                             ext2_ino_t inode);
91 extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
92                                          ext2_ino_t inode);
93 extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
94 extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
95 extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
96 extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
97
98 extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
99                                            blk_t block, int num);
100 extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
101                                              blk_t block, int num);
102 extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
103                                           blk_t block, int num);
104 extern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,
105                                           ino_t inode, int num);
106 extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
107                                                 blk_t block, int num);
108 extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
109                                                   blk_t block, int num);
110 extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
111                                                blk_t block, int num);
112 extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);
113
114 /* These routines moved to gen_bitmap.c (actually, some of the above, too) */
115 extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
116                                          __u32 bitno);
117 extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
118                                            blk_t bitno);
119 extern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
120                                       blk_t bitno);
121 extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
122                                           blk_t block, int num);
123 extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);
124 extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);
125
126 /* 64-bit versions */
127
128 extern int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
129                                      blk64_t block);
130 extern int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
131                                        blk64_t block);
132 extern int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap,
133                                      blk64_t block);
134
135 extern int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
136                                      ext2_ino_t inode);
137 extern int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
138                                        ext2_ino_t inode);
139 extern int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
140                                      ext2_ino_t inode);
141
142 extern void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
143                                            blk64_t block);
144 extern void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
145                                              blk64_t block);
146 extern int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap,
147                                           blk64_t block);
148
149 extern void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
150                                            ext2_ino_t inode);
151 extern void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
152                                             ext2_ino_t inode);
153 extern int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
154                                           ext2_ino_t inode);
155 extern blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap);
156 extern ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap);
157 extern blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap);
158 extern ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap);
159
160 extern int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
161                                                 blk64_t block,
162                                                 unsigned int num);
163 extern void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
164                                                  blk64_t block,
165                                                  unsigned int num);
166 extern void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
167                                                    blk64_t block,
168                                                    unsigned int num);
169 /* These routines moved to gen_bitmap64.c */
170 extern void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap);
171 extern errcode_t ext2fs_compare_generic_bmap(errcode_t neq,
172                                              ext2fs_generic_bitmap bm1,
173                                              ext2fs_generic_bitmap bm2);
174 extern void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap);
175 extern int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap,
176                                     blk64_t bitno);
177 extern int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap,
178                                       blk64_t bitno);
179 extern int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap,
180                                     blk64_t bitno);
181 extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
182                                            blk64_t block, unsigned int num);
183 extern __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap);
184 extern __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap);
185 extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
186                                            blk64_t block, unsigned int num);
187 extern void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
188                                             blk64_t block, unsigned int num);
189 extern void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
190                                               blk64_t block, unsigned int num);
191
192 /*
193  * The inline routines themselves...
194  *
195  * If NO_INLINE_FUNCS is defined, then we won't try to do inline
196  * functions at all; they will be included as normal functions in
197  * inline.c
198  */
199 #ifdef NO_INLINE_FUNCS
200 #if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \
201                            defined(__i586__) || defined(__mc68000__)))
202         /* This prevents bitops.c from trying to include the C */
203         /* function version of these functions */
204 #define _EXT2_HAVE_ASM_BITOPS_
205 #endif
206 #endif /* NO_INLINE_FUNCS */
207
208 #if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
209 #ifdef INCLUDE_INLINE_FUNCS
210 #define _INLINE_ extern
211 #else
212 #ifdef __GNUC__
213 #define _INLINE_ extern __inline__
214 #else                           /* For Watcom C */
215 #define _INLINE_ extern inline
216 #endif
217 #endif
218
219 /*
220  * Fast bit set/clear functions that doesn't need to return the
221  * previous bit value.
222  */
223
224 _INLINE_ void ext2fs_fast_set_bit(unsigned int nr,void * addr)
225 {
226         unsigned char   *ADDR = (unsigned char *) addr;
227
228         ADDR += nr >> 3;
229         *ADDR |= (1 << (nr & 0x07));
230 }
231
232 _INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr)
233 {
234         unsigned char   *ADDR = (unsigned char *) addr;
235
236         ADDR += nr >> 3;
237         *ADDR &= ~(1 << (nr & 0x07));
238 }
239
240
241 _INLINE_ void ext2fs_fast_set_bit64(__u64 nr, void * addr)
242 {
243         unsigned char   *ADDR = (unsigned char *) addr;
244
245         ADDR += nr >> 3;
246         *ADDR |= (1 << (nr & 0x07));
247 }
248
249 _INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr)
250 {
251         unsigned char   *ADDR = (unsigned char *) addr;
252
253         ADDR += nr >> 3;
254         *ADDR &= ~(1 << (nr & 0x07));
255 }
256
257
258 #if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \
259      (defined(__i386__) || defined(__i486__) || defined(__i586__)))
260
261 #define _EXT2_HAVE_ASM_BITOPS_
262 #define _EXT2_HAVE_ASM_SWAB_
263
264 /*
265  * These are done by inline assembly for speed reasons.....
266  *
267  * All bitoperations return 0 if the bit was cleared before the
268  * operation and != 0 if it was not.  Bit 0 is the LSB of addr; bit 32
269  * is the LSB of (addr+1).
270  */
271
272 /*
273  * Some hacks to defeat gcc over-optimizations..
274  */
275 struct __dummy_h { unsigned long a[100]; };
276 #define EXT2FS_ADDR (*(struct __dummy_h *) addr)
277 #define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr)
278
279 _INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr)
280 {
281         int oldbit;
282
283         addr = (void *) (((unsigned char *) addr) + (nr >> 3));
284         __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0"
285                 :"=r" (oldbit),"+m" (EXT2FS_ADDR)
286                 :"r" (nr & 7));
287         return oldbit;
288 }
289
290 _INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr)
291 {
292         int oldbit;
293
294         addr = (void *) (((unsigned char *) addr) + (nr >> 3));
295         __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0"
296                 :"=r" (oldbit),"+m" (EXT2FS_ADDR)
297                 :"r" (nr & 7));
298         return oldbit;
299 }
300
301 _INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)
302 {
303         int oldbit;
304
305         addr = (const void *) (((const unsigned char *) addr) + (nr >> 3));
306         __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
307                 :"=r" (oldbit)
308                 :"m" (EXT2FS_CONST_ADDR),"r" (nr & 7));
309         return oldbit;
310 }
311
312 _INLINE_ __u32 ext2fs_swab32(__u32 val)
313 {
314 #ifdef EXT2FS_REQUIRE_486
315         __asm__("bswap %0" : "=r" (val) : "0" (val));
316 #else
317         __asm__("xchgb %b0,%h0\n\t"     /* swap lower bytes     */
318                 "rorl $16,%0\n\t"       /* swap words           */
319                 "xchgb %b0,%h0"         /* swap higher bytes    */
320                 :"=q" (val)
321                 : "0" (val));
322 #endif
323         return val;
324 }
325
326 _INLINE_ __u16 ext2fs_swab16(__u16 val)
327 {
328         __asm__("xchgb %b0,%h0"         /* swap bytes           */ \
329                 : "=q" (val) \
330                 :  "0" (val)); \
331                 return val;
332 }
333
334 #undef EXT2FS_ADDR
335
336 #endif  /* i386 */
337
338 #if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \
339      (defined(__mc68000__)))
340
341 #define _EXT2_HAVE_ASM_BITOPS_
342
343 _INLINE_ int ext2fs_set_bit(unsigned int nr,void * addr)
344 {
345         char retval;
346
347         __asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
348              : "=d" (retval) : "d" (nr^7), "a" (addr));
349
350         return retval;
351 }
352
353 _INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr)
354 {
355         char retval;
356
357         __asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
358              : "=d" (retval) : "d" (nr^7), "a" (addr));
359
360         return retval;
361 }
362
363 _INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)
364 {
365         char retval;
366
367         __asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
368              : "=d" (retval) : "d" (nr^7), "a" (addr));
369
370         return retval;
371 }
372
373 #endif /* __mc68000__ */
374
375
376 #if !defined(_EXT2_HAVE_ASM_SWAB_)
377
378 _INLINE_ __u16 ext2fs_swab16(__u16 val)
379 {
380         return (val >> 8) | (val << 8);
381 }
382
383 _INLINE_ __u32 ext2fs_swab32(__u32 val)
384 {
385         return ((val>>24) | ((val>>8)&0xFF00) |
386                 ((val<<8)&0xFF0000) | (val<<24));
387 }
388
389 #endif /* !_EXT2_HAVE_ASM_SWAB */
390
391 _INLINE_ __u64 ext2fs_swab64(__u64 val)
392 {
393         return (ext2fs_swab32(val >> 32) |
394                 (((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32));
395 }
396
397 _INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
398                                        blk_t block)
399 {
400         return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
401                                           block);
402 }
403
404 _INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
405                                          blk_t block)
406 {
407         return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
408                                             block);
409 }
410
411 _INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
412                                        blk_t block)
413 {
414         return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
415                                           block);
416 }
417
418 _INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
419                                        ext2_ino_t inode)
420 {
421         return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
422                                           inode);
423 }
424
425 _INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
426                                          ext2_ino_t inode)
427 {
428         return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
429                                      inode);
430 }
431
432 _INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
433                                        ext2_ino_t inode)
434 {
435         return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
436                                           inode);
437 }
438
439 _INLINE_ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
440                                             blk_t block)
441 {
442         ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
443 }
444
445 _INLINE_ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
446                                               blk_t block)
447 {
448         ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
449 }
450
451 _INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
452                                             blk_t block)
453 {
454         return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
455                                           block);
456 }
457
458 _INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
459                                             ext2_ino_t inode)
460 {
461         ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
462 }
463
464 _INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
465                                               ext2_ino_t inode)
466 {
467         ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
468 }
469
470 _INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
471                                            ext2_ino_t inode)
472 {
473         return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
474                                           inode);
475 }
476
477 _INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap)
478 {
479         return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);
480 }
481
482 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)
483 {
484         return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);
485 }
486
487 _INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap)
488 {
489         return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);
490 }
491
492 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)
493 {
494         return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);
495 }
496
497 _INLINE_ int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
498                                                  blk_t block, int num)
499 {
500         return ext2fs_test_block_bitmap_range(bitmap, block, num);
501 }
502
503 _INLINE_ void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
504                                                   blk_t block, int num)
505 {
506         ext2fs_mark_block_bitmap_range(bitmap, block, num);
507 }
508
509 _INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
510                                                     blk_t block, int num)
511 {
512         ext2fs_unmark_block_bitmap_range(bitmap, block, num);
513 }
514
515 /* 64-bit versions */
516
517 _INLINE_ int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
518                                        blk64_t block)
519 {
520         return ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap,
521                                         block);
522 }
523
524 _INLINE_ int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
525                                          blk64_t block)
526 {
527         return ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);
528 }
529
530 _INLINE_ int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap,
531                                        blk64_t block)
532 {
533         return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,
534                                         block);
535 }
536
537 _INLINE_ int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
538                                        ext2_ino_t inode)
539 {
540         return ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap,
541                                         inode);
542 }
543
544 _INLINE_ int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
545                                          ext2_ino_t inode)
546 {
547         return ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap,
548                                           inode);
549 }
550
551 _INLINE_ int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
552                                        ext2_ino_t inode)
553 {
554         return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,
555                                         inode);
556 }
557
558 _INLINE_ void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
559                                              blk64_t block)
560 {
561         ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);
562 }
563
564 _INLINE_ void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
565                                                blk64_t block)
566 {
567         ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);
568 }
569
570 _INLINE_ int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap,
571                                             blk64_t block)
572 {
573         return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,
574                                         block);
575 }
576
577 _INLINE_ void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
578                                              ext2_ino_t inode)
579 {
580         ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode);
581 }
582
583 _INLINE_ void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
584                                                ext2_ino_t inode)
585 {
586         ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode);
587 }
588
589 _INLINE_ int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
590                                             ext2_ino_t inode)
591 {
592         return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,
593                                         inode);
594 }
595
596 _INLINE_ blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap)
597 {
598         return ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);
599 }
600
601 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap)
602 {
603         return ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);
604 }
605
606 _INLINE_ blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap)
607 {
608         return ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);
609 }
610
611 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap)
612 {
613         return ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);
614 }
615
616 _INLINE_ int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
617                                                   blk64_t block,
618                                                   unsigned int num)
619 {
620         return ext2fs_test_block_bitmap_range2(bitmap, block, num);
621 }
622
623 _INLINE_ void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
624                                                    blk64_t block,
625                                                    unsigned int num)
626 {
627         ext2fs_mark_block_bitmap_range2(bitmap, block, num);
628 }
629
630 _INLINE_ void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
631                                                      blk64_t block,
632                                                      unsigned int num)
633 {
634         ext2fs_unmark_block_bitmap_range2(bitmap, block, num);
635 }
636
637 #undef _INLINE_
638 #endif
639