Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/ext2fs
File: bitops.h
/*
[0] Fix | Delete
* bitops.h --- Bitmap frobbing code. The byte swapping routines are
[1] Fix | Delete
* also included here.
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
[4] Fix | Delete
*
[5] Fix | Delete
* %Begin-Header%
[6] Fix | Delete
* This file may be redistributed under the terms of the GNU Library
[7] Fix | Delete
* General Public License, version 2.
[8] Fix | Delete
* %End-Header%
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
#ifdef WORDS_BIGENDIAN
[12] Fix | Delete
#define ext2fs_cpu_to_le64(x) ((__force __le64)ext2fs_swab64((__u64)(x)))
[13] Fix | Delete
#define ext2fs_le64_to_cpu(x) ext2fs_swab64((__force __u64)(__le64)(x))
[14] Fix | Delete
#define ext2fs_cpu_to_le32(x) ((__force __le32)ext2fs_swab32((__u32)(x)))
[15] Fix | Delete
#define ext2fs_le32_to_cpu(x) ext2fs_swab32((__force __u32)(__le32)(x))
[16] Fix | Delete
#define ext2fs_cpu_to_le16(x) ((__force __le16)ext2fs_swab16((__u16)(x)))
[17] Fix | Delete
#define ext2fs_le16_to_cpu(x) ext2fs_swab16((__force __u16)(__le16)(x))
[18] Fix | Delete
[19] Fix | Delete
#define ext2fs_cpu_to_be64(x) ((__force __be64)(__u64)(x))
[20] Fix | Delete
#define ext2fs_be64_to_cpu(x) ((__force __u64)(__be64)(x))
[21] Fix | Delete
#define ext2fs_cpu_to_be32(x) ((__force __be32)(__u32)(x))
[22] Fix | Delete
#define ext2fs_be32_to_cpu(x) ((__force __u32)(__be32)(x))
[23] Fix | Delete
#define ext2fs_cpu_to_be16(x) ((__force __be16)(__u16)(x))
[24] Fix | Delete
#define ext2fs_be16_to_cpu(x) ((__force __u16)(__be16)(x))
[25] Fix | Delete
#else
[26] Fix | Delete
#define ext2fs_cpu_to_le64(x) ((__force __le64)(__u64)(x))
[27] Fix | Delete
#define ext2fs_le64_to_cpu(x) ((__force __u64)(__le64)(x))
[28] Fix | Delete
#define ext2fs_cpu_to_le32(x) ((__force __le32)(__u32)(x))
[29] Fix | Delete
#define ext2fs_le32_to_cpu(x) ((__force __u32)(__le32)(x))
[30] Fix | Delete
#define ext2fs_cpu_to_le16(x) ((__force __le16)(__u16)(x))
[31] Fix | Delete
#define ext2fs_le16_to_cpu(x) ((__force __u16)(__le16)(x))
[32] Fix | Delete
[33] Fix | Delete
#define ext2fs_cpu_to_be64(x) ((__force __be64)ext2fs_swab64((__u64)(x)))
[34] Fix | Delete
#define ext2fs_be64_to_cpu(x) ext2fs_swab64((__force __u64)(__be64)(x))
[35] Fix | Delete
#define ext2fs_cpu_to_be32(x) ((__force __be32)ext2fs_swab32((__u32)(x)))
[36] Fix | Delete
#define ext2fs_be32_to_cpu(x) ext2fs_swab32((__force __u32)(__be32)(x))
[37] Fix | Delete
#define ext2fs_cpu_to_be16(x) ((__force __be16)ext2fs_swab16((__u16)(x)))
[38] Fix | Delete
#define ext2fs_be16_to_cpu(x) ext2fs_swab16((__force __u16)(__be16)(x))
[39] Fix | Delete
#endif
[40] Fix | Delete
[41] Fix | Delete
/*
[42] Fix | Delete
* EXT2FS bitmap manipulation routines.
[43] Fix | Delete
*/
[44] Fix | Delete
[45] Fix | Delete
/* Support for sending warning messages from the inline subroutines */
[46] Fix | Delete
extern const char *ext2fs_block_string;
[47] Fix | Delete
extern const char *ext2fs_inode_string;
[48] Fix | Delete
extern const char *ext2fs_mark_string;
[49] Fix | Delete
extern const char *ext2fs_unmark_string;
[50] Fix | Delete
extern const char *ext2fs_test_string;
[51] Fix | Delete
extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
[52] Fix | Delete
const char *description);
[53] Fix | Delete
extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
[54] Fix | Delete
int code, unsigned long arg);
[55] Fix | Delete
[56] Fix | Delete
#ifdef NO_INLINE_FUNCS
[57] Fix | Delete
extern void ext2fs_fast_set_bit(unsigned int nr,void * addr);
[58] Fix | Delete
extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr);
[59] Fix | Delete
extern void ext2fs_fast_set_bit64(__u64 nr,void * addr);
[60] Fix | Delete
extern void ext2fs_fast_clear_bit64(__u64 nr, void * addr);
[61] Fix | Delete
extern __u16 ext2fs_swab16(__u16 val);
[62] Fix | Delete
extern __u32 ext2fs_swab32(__u32 val);
[63] Fix | Delete
extern __u64 ext2fs_swab64(__u64 val);
[64] Fix | Delete
[65] Fix | Delete
extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
[66] Fix | Delete
extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
[67] Fix | Delete
blk_t block);
[68] Fix | Delete
extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
[69] Fix | Delete
[70] Fix | Delete
extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
[71] Fix | Delete
extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[72] Fix | Delete
ext2_ino_t inode);
[73] Fix | Delete
extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
[74] Fix | Delete
[75] Fix | Delete
extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
[76] Fix | Delete
blk_t block);
[77] Fix | Delete
extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
[78] Fix | Delete
blk_t block);
[79] Fix | Delete
extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
[80] Fix | Delete
blk_t block);
[81] Fix | Delete
[82] Fix | Delete
extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[83] Fix | Delete
ext2_ino_t inode);
[84] Fix | Delete
extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[85] Fix | Delete
ext2_ino_t inode);
[86] Fix | Delete
extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
[87] Fix | Delete
ext2_ino_t inode);
[88] Fix | Delete
extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
[89] Fix | Delete
extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
[90] Fix | Delete
extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
[91] Fix | Delete
extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
[92] Fix | Delete
[93] Fix | Delete
extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
[94] Fix | Delete
blk_t block, int num);
[95] Fix | Delete
extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
[96] Fix | Delete
blk_t block, int num);
[97] Fix | Delete
extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
[98] Fix | Delete
blk_t block, int num);
[99] Fix | Delete
#endif
[100] Fix | Delete
[101] Fix | Delete
/* These functions routines moved to gen_bitmap.c */
[102] Fix | Delete
extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
[103] Fix | Delete
blk_t block, int num);
[104] Fix | Delete
extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
[105] Fix | Delete
blk_t block, int num);
[106] Fix | Delete
extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
[107] Fix | Delete
blk_t block, int num);
[108] Fix | Delete
extern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,
[109] Fix | Delete
ext2_ino_t inode, int num);
[110] Fix | Delete
extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
[111] Fix | Delete
__u32 bitno);
[112] Fix | Delete
extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
[113] Fix | Delete
blk_t bitno);
[114] Fix | Delete
extern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
[115] Fix | Delete
blk_t bitno);
[116] Fix | Delete
extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
[117] Fix | Delete
blk_t block, int num);
[118] Fix | Delete
extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);
[119] Fix | Delete
extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);
[120] Fix | Delete
extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);
[121] Fix | Delete
[122] Fix | Delete
/* 64-bit versions */
[123] Fix | Delete
[124] Fix | Delete
#ifdef NO_INLINE_FUNCS
[125] Fix | Delete
extern int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
[126] Fix | Delete
blk64_t block);
[127] Fix | Delete
extern int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
[128] Fix | Delete
blk64_t block);
[129] Fix | Delete
extern int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap,
[130] Fix | Delete
blk64_t block);
[131] Fix | Delete
[132] Fix | Delete
extern int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[133] Fix | Delete
ext2_ino_t inode);
[134] Fix | Delete
extern int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[135] Fix | Delete
ext2_ino_t inode);
[136] Fix | Delete
extern int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[137] Fix | Delete
ext2_ino_t inode);
[138] Fix | Delete
[139] Fix | Delete
extern void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap,
[140] Fix | Delete
blk64_t block);
[141] Fix | Delete
extern void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,
[142] Fix | Delete
blk64_t block);
[143] Fix | Delete
extern int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap,
[144] Fix | Delete
blk64_t block);
[145] Fix | Delete
[146] Fix | Delete
extern void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[147] Fix | Delete
ext2_ino_t inode);
[148] Fix | Delete
extern void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[149] Fix | Delete
ext2_ino_t inode);
[150] Fix | Delete
extern int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[151] Fix | Delete
ext2_ino_t inode);
[152] Fix | Delete
extern errcode_t ext2fs_find_first_zero_block_bitmap2(ext2fs_block_bitmap bitmap,
[153] Fix | Delete
blk64_t start,
[154] Fix | Delete
blk64_t end,
[155] Fix | Delete
blk64_t *out);
[156] Fix | Delete
extern errcode_t ext2fs_find_first_zero_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[157] Fix | Delete
ext2_ino_t start,
[158] Fix | Delete
ext2_ino_t end,
[159] Fix | Delete
ext2_ino_t *out);
[160] Fix | Delete
extern errcode_t ext2fs_find_first_set_block_bitmap2(ext2fs_block_bitmap bitmap,
[161] Fix | Delete
blk64_t start,
[162] Fix | Delete
blk64_t end,
[163] Fix | Delete
blk64_t *out);
[164] Fix | Delete
extern errcode_t ext2fs_find_first_set_inode_bitmap2(ext2fs_inode_bitmap bitmap,
[165] Fix | Delete
ext2_ino_t start,
[166] Fix | Delete
ext2_ino_t end,
[167] Fix | Delete
ext2_ino_t *out);
[168] Fix | Delete
extern blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap);
[169] Fix | Delete
extern ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap);
[170] Fix | Delete
extern blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap);
[171] Fix | Delete
extern ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap);
[172] Fix | Delete
[173] Fix | Delete
extern int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[174] Fix | Delete
blk64_t block,
[175] Fix | Delete
unsigned int num);
[176] Fix | Delete
extern void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[177] Fix | Delete
blk64_t block,
[178] Fix | Delete
unsigned int num);
[179] Fix | Delete
extern void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[180] Fix | Delete
blk64_t block,
[181] Fix | Delete
unsigned int num);
[182] Fix | Delete
#endif
[183] Fix | Delete
[184] Fix | Delete
/* These routines moved to gen_bitmap64.c */
[185] Fix | Delete
extern void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap);
[186] Fix | Delete
extern errcode_t ext2fs_compare_generic_bmap(errcode_t neq,
[187] Fix | Delete
ext2fs_generic_bitmap bm1,
[188] Fix | Delete
ext2fs_generic_bitmap bm2);
[189] Fix | Delete
extern void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap);
[190] Fix | Delete
extern int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap,
[191] Fix | Delete
blk64_t bitno);
[192] Fix | Delete
extern int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap,
[193] Fix | Delete
blk64_t bitno);
[194] Fix | Delete
extern int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap,
[195] Fix | Delete
blk64_t bitno);
[196] Fix | Delete
extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[197] Fix | Delete
blk64_t block, unsigned int num);
[198] Fix | Delete
extern __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap);
[199] Fix | Delete
extern __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap);
[200] Fix | Delete
extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[201] Fix | Delete
blk64_t block, unsigned int num);
[202] Fix | Delete
extern void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[203] Fix | Delete
blk64_t block, unsigned int num);
[204] Fix | Delete
extern void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,
[205] Fix | Delete
blk64_t block, unsigned int num);
[206] Fix | Delete
extern errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,
[207] Fix | Delete
__u64 start, __u64 end,
[208] Fix | Delete
__u64 *out);
[209] Fix | Delete
extern errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap,
[210] Fix | Delete
__u64 start, __u64 end,
[211] Fix | Delete
__u64 *out);
[212] Fix | Delete
[213] Fix | Delete
/*
[214] Fix | Delete
* The inline routines themselves...
[215] Fix | Delete
*
[216] Fix | Delete
* If NO_INLINE_FUNCS is defined, then we won't try to do inline
[217] Fix | Delete
* functions at all; they will be included as normal functions in
[218] Fix | Delete
* inline.c
[219] Fix | Delete
*/
[220] Fix | Delete
#ifdef NO_INLINE_FUNCS
[221] Fix | Delete
#if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \
[222] Fix | Delete
defined(__i586__)))
[223] Fix | Delete
/* This prevents bitops.c from trying to include the C */
[224] Fix | Delete
/* function version of these functions */
[225] Fix | Delete
#define _EXT2_HAVE_ASM_BITOPS_
[226] Fix | Delete
#endif
[227] Fix | Delete
#endif /* NO_INLINE_FUNCS */
[228] Fix | Delete
[229] Fix | Delete
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
[230] Fix | Delete
#ifdef INCLUDE_INLINE_FUNCS
[231] Fix | Delete
#if (__STDC_VERSION__ >= 199901L)
[232] Fix | Delete
#define _INLINE_ extern inline
[233] Fix | Delete
#else
[234] Fix | Delete
#define _INLINE_ inline
[235] Fix | Delete
#endif
[236] Fix | Delete
#else /* !INCLUDE_INLINE FUNCS */
[237] Fix | Delete
#if (__STDC_VERSION__ >= 199901L)
[238] Fix | Delete
#define _INLINE_ inline
[239] Fix | Delete
#else /* not C99 */
[240] Fix | Delete
#ifdef __GNUC__
[241] Fix | Delete
#define _INLINE_ extern __inline__
[242] Fix | Delete
#else /* For Watcom C */
[243] Fix | Delete
#define _INLINE_ extern inline
[244] Fix | Delete
#endif /* __GNUC__ */
[245] Fix | Delete
#endif /* __STDC_VERSION__ >= 199901L */
[246] Fix | Delete
#endif /* INCLUDE_INLINE_FUNCS */
[247] Fix | Delete
[248] Fix | Delete
/*
[249] Fix | Delete
* Fast bit set/clear functions that doesn't need to return the
[250] Fix | Delete
* previous bit value.
[251] Fix | Delete
*/
[252] Fix | Delete
[253] Fix | Delete
_INLINE_ void ext2fs_fast_set_bit(unsigned int nr,void * addr)
[254] Fix | Delete
{
[255] Fix | Delete
unsigned char *ADDR = (unsigned char *) addr;
[256] Fix | Delete
[257] Fix | Delete
ADDR += nr >> 3;
[258] Fix | Delete
*ADDR |= (unsigned char) (1 << (nr & 0x07));
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
_INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr)
[262] Fix | Delete
{
[263] Fix | Delete
unsigned char *ADDR = (unsigned char *) addr;
[264] Fix | Delete
[265] Fix | Delete
ADDR += nr >> 3;
[266] Fix | Delete
*ADDR &= (unsigned char) ~(1 << (nr & 0x07));
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
[270] Fix | Delete
_INLINE_ void ext2fs_fast_set_bit64(__u64 nr, void * addr)
[271] Fix | Delete
{
[272] Fix | Delete
unsigned char *ADDR = (unsigned char *) addr;
[273] Fix | Delete
[274] Fix | Delete
ADDR += nr >> 3;
[275] Fix | Delete
*ADDR |= (unsigned char) (1 << (nr & 0x07));
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
_INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr)
[279] Fix | Delete
{
[280] Fix | Delete
unsigned char *ADDR = (unsigned char *) addr;
[281] Fix | Delete
[282] Fix | Delete
ADDR += nr >> 3;
[283] Fix | Delete
*ADDR &= (unsigned char) ~(1 << (nr & 0x07));
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
[287] Fix | Delete
#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \
[288] Fix | Delete
(defined(__i386__) || defined(__i486__) || defined(__i586__)))
[289] Fix | Delete
[290] Fix | Delete
#define _EXT2_HAVE_ASM_BITOPS_
[291] Fix | Delete
#define _EXT2_HAVE_ASM_SWAB_
[292] Fix | Delete
[293] Fix | Delete
/*
[294] Fix | Delete
* These are done by inline assembly for speed reasons.....
[295] Fix | Delete
*
[296] Fix | Delete
* All bitoperations return 0 if the bit was cleared before the
[297] Fix | Delete
* operation and != 0 if it was not. Bit 0 is the LSB of addr; bit 32
[298] Fix | Delete
* is the LSB of (addr+1).
[299] Fix | Delete
*/
[300] Fix | Delete
[301] Fix | Delete
/*
[302] Fix | Delete
* Some hacks to defeat gcc over-optimizations..
[303] Fix | Delete
*/
[304] Fix | Delete
struct __dummy_h { unsigned long a[100]; };
[305] Fix | Delete
#define EXT2FS_ADDR (*(struct __dummy_h *) addr)
[306] Fix | Delete
#define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr)
[307] Fix | Delete
[308] Fix | Delete
_INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr)
[309] Fix | Delete
{
[310] Fix | Delete
int oldbit;
[311] Fix | Delete
[312] Fix | Delete
addr = (void *) (((unsigned char *) addr) + (nr >> 3));
[313] Fix | Delete
__asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0"
[314] Fix | Delete
:"=r" (oldbit),"+m" (EXT2FS_ADDR)
[315] Fix | Delete
:"r" (nr & 7));
[316] Fix | Delete
return oldbit;
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
_INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr)
[320] Fix | Delete
{
[321] Fix | Delete
int oldbit;
[322] Fix | Delete
[323] Fix | Delete
addr = (void *) (((unsigned char *) addr) + (nr >> 3));
[324] Fix | Delete
__asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0"
[325] Fix | Delete
:"=r" (oldbit),"+m" (EXT2FS_ADDR)
[326] Fix | Delete
:"r" (nr & 7));
[327] Fix | Delete
return oldbit;
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
_INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)
[331] Fix | Delete
{
[332] Fix | Delete
int oldbit;
[333] Fix | Delete
[334] Fix | Delete
addr = (const void *) (((const unsigned char *) addr) + (nr >> 3));
[335] Fix | Delete
__asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
[336] Fix | Delete
:"=r" (oldbit)
[337] Fix | Delete
:"m" (EXT2FS_CONST_ADDR),"r" (nr & 7));
[338] Fix | Delete
return oldbit;
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
_INLINE_ __u32 ext2fs_swab32(__u32 val)
[342] Fix | Delete
{
[343] Fix | Delete
#ifdef EXT2FS_REQUIRE_486
[344] Fix | Delete
__asm__("bswap %0" : "=r" (val) : "0" (val));
[345] Fix | Delete
#else
[346] Fix | Delete
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
[347] Fix | Delete
"rorl $16,%0\n\t" /* swap words */
[348] Fix | Delete
"xchgb %b0,%h0" /* swap higher bytes */
[349] Fix | Delete
:"=q" (val)
[350] Fix | Delete
: "0" (val));
[351] Fix | Delete
#endif
[352] Fix | Delete
return val;
[353] Fix | Delete
}
[354] Fix | Delete
[355] Fix | Delete
_INLINE_ __u16 ext2fs_swab16(__u16 val)
[356] Fix | Delete
{
[357] Fix | Delete
__asm__("xchgb %b0,%h0" /* swap bytes */ \
[358] Fix | Delete
: "=q" (val) \
[359] Fix | Delete
: "0" (val)); \
[360] Fix | Delete
return val;
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
#undef EXT2FS_ADDR
[364] Fix | Delete
[365] Fix | Delete
#endif /* i386 */
[366] Fix | Delete
[367] Fix | Delete
[368] Fix | Delete
#if !defined(_EXT2_HAVE_ASM_SWAB_)
[369] Fix | Delete
[370] Fix | Delete
_INLINE_ __u16 ext2fs_swab16(__u16 val)
[371] Fix | Delete
{
[372] Fix | Delete
return (val >> 8) | (__u16) (val << 8);
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
_INLINE_ __u32 ext2fs_swab32(__u32 val)
[376] Fix | Delete
{
[377] Fix | Delete
return ((val>>24) | ((val>>8)&0xFF00) |
[378] Fix | Delete
((val<<8)&0xFF0000) | (val<<24));
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
#endif /* !_EXT2_HAVE_ASM_SWAB */
[382] Fix | Delete
[383] Fix | Delete
_INLINE_ __u64 ext2fs_swab64(__u64 val)
[384] Fix | Delete
{
[385] Fix | Delete
return (ext2fs_swab32((__u32) (val >> 32)) |
[386] Fix | Delete
(((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32));
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
_INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
[390] Fix | Delete
blk_t block)
[391] Fix | Delete
{
[392] Fix | Delete
return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[393] Fix | Delete
block);
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
_INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
[397] Fix | Delete
blk_t block)
[398] Fix | Delete
{
[399] Fix | Delete
return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[400] Fix | Delete
block);
[401] Fix | Delete
}
[402] Fix | Delete
[403] Fix | Delete
_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
[404] Fix | Delete
blk_t block)
[405] Fix | Delete
{
[406] Fix | Delete
return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[407] Fix | Delete
block);
[408] Fix | Delete
}
[409] Fix | Delete
[410] Fix | Delete
_INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[411] Fix | Delete
ext2_ino_t inode)
[412] Fix | Delete
{
[413] Fix | Delete
return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[414] Fix | Delete
inode);
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
_INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[418] Fix | Delete
ext2_ino_t inode)
[419] Fix | Delete
{
[420] Fix | Delete
return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[421] Fix | Delete
inode);
[422] Fix | Delete
}
[423] Fix | Delete
[424] Fix | Delete
_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
[425] Fix | Delete
ext2_ino_t inode)
[426] Fix | Delete
{
[427] Fix | Delete
return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[428] Fix | Delete
inode);
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
_INLINE_ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
[432] Fix | Delete
blk_t block)
[433] Fix | Delete
{
[434] Fix | Delete
ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
[435] Fix | Delete
}
[436] Fix | Delete
[437] Fix | Delete
_INLINE_ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
[438] Fix | Delete
blk_t block)
[439] Fix | Delete
{
[440] Fix | Delete
ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
[441] Fix | Delete
}
[442] Fix | Delete
[443] Fix | Delete
_INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
[444] Fix | Delete
blk_t block)
[445] Fix | Delete
{
[446] Fix | Delete
return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[447] Fix | Delete
block);
[448] Fix | Delete
}
[449] Fix | Delete
[450] Fix | Delete
_INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[451] Fix | Delete
ext2_ino_t inode)
[452] Fix | Delete
{
[453] Fix | Delete
ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
[454] Fix | Delete
}
[455] Fix | Delete
[456] Fix | Delete
_INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
[457] Fix | Delete
ext2_ino_t inode)
[458] Fix | Delete
{
[459] Fix | Delete
ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
_INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
[463] Fix | Delete
ext2_ino_t inode)
[464] Fix | Delete
{
[465] Fix | Delete
return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
[466] Fix | Delete
inode);
[467] Fix | Delete
}
[468] Fix | Delete
[469] Fix | Delete
_INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap)
[470] Fix | Delete
{
[471] Fix | Delete
return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);
[472] Fix | Delete
}
[473] Fix | Delete
[474] Fix | Delete
_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)
[475] Fix | Delete
{
[476] Fix | Delete
return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);
[477] Fix | Delete
}
[478] Fix | Delete
[479] Fix | Delete
_INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap)
[480] Fix | Delete
{
[481] Fix | Delete
return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)
[485] Fix | Delete
{
[486] Fix | Delete
return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
_INLINE_ int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
[490] Fix | Delete
blk_t block, int num)
[491] Fix | Delete
{
[492] Fix | Delete
return ext2fs_test_block_bitmap_range(bitmap, block, num);
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
_INLINE_ void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
[496] Fix | Delete
blk_t block, int num)
[497] Fix | Delete
{
[498] Fix | Delete
ext2fs_mark_block_bitmap_range(bitmap, block, num);
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function