Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 297243 | Differences between
and this patch

Collapse All | Expand All

(-)a/e2fsck/jfs_user.h (-9 / +19 lines)
Lines 70-94 typedef unsigned int __be32; Link Here
70
 */
70
 */
71
#include <ext2fs/kernel-jbd.h>
71
#include <ext2fs/kernel-jbd.h>
72
72
73
/*
73
#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__)
74
 * We use the standard libext2fs portability tricks for inline
74
#  define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */
75
 * functions.
75
#endif
76
 */
76
#define STORAGE_CLASS extern
77
extern lkmem_cache_t * do_cache_create(int len);
78
extern void do_cache_destroy(lkmem_cache_t *cache);
79
extern size_t journal_tag_bytes(journal_t *journal);
80
81
#if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
77
#if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
82
#ifdef E2FSCK_INCLUDE_INLINE_FUNCS
78
#ifdef E2FSCK_INCLUDE_INLINE_FUNCS
83
#define _INLINE_ extern
79
#define _INLINE_ extern
84
#else
80
#else
85
#ifdef __GNUC__
81
#if defined(__GNUC_GNU_INLINE__)
86
#define _INLINE_ extern __inline__
82
#define _INLINE_ extern __inline__
83
#elif defined(__GNUC_STDC_INLINE__) || \
84
    (defined(__STDC__) && __STDC_VERSION__ >= 199901L)
85
#undef STORAGE_CLASS
86
#define STORAGE_CLASS inline
87
#define _INLINE_ inline
87
#else				/* For Watcom C */
88
#else				/* For Watcom C */
88
#define _INLINE_ extern inline
89
#define _INLINE_ extern inline
89
#endif
90
#endif
90
#endif
91
#endif
91
92
93
/*
94
 * We use the standard libext2fs portability tricks for inline
95
 * functions.
96
 */
97
STORAGE_CLASS lkmem_cache_t * do_cache_create(int len);
98
STORAGE_CLASS void do_cache_destroy(lkmem_cache_t *cache);
99
STORAGE_CLASS size_t journal_tag_bytes(journal_t *journal);
100
92
_INLINE_ lkmem_cache_t * do_cache_create(int len)
101
_INLINE_ lkmem_cache_t * do_cache_create(int len)
93
{
102
{
94
	lkmem_cache_t *new_cache;
103
	lkmem_cache_t *new_cache;
Lines 114-119 _INLINE_ size_t journal_tag_bytes(journal_t *journal) Link Here
114
		return JBD_TAG_SIZE32;
123
		return JBD_TAG_SIZE32;
115
}
124
}
116
125
126
#undef STORAGE_CLASS
117
#undef _INLINE_
127
#undef _INLINE_
118
#endif
128
#endif
119
129
(-)a/lib/ext2fs/bitops.h (-50 / +59 lines)
Lines 13-27 Link Here
13
 * Linus Torvalds.
13
 * Linus Torvalds.
14
 */
14
 */
15
15
16
#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__)
17
#  define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */
18
#endif
19
#define STORAGE_CLASS extern
20
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
21
#ifdef INCLUDE_INLINE_FUNCS
22
#define _INLINE_ extern
23
#else
24
#if defined(__GNUC_GNU_INLINE__)
25
#define _INLINE_ extern __inline__
26
#elif defined(__GNUC_STDC_INLINE__) || \
27
    (defined(__STDC__) && __STDC_VERSION__ >= 199901L)
28
#undef STORAGE_CLASS
29
#define STORAGE_CLASS inline
30
#define _INLINE_ inline
31
#else				/* For Watcom C */
32
#define _INLINE_ extern inline
33
#endif
34
#endif
16
35
17
extern int ext2fs_set_bit(unsigned int nr,void * addr);
36
STORAGE_CLASS int ext2fs_set_bit(unsigned int nr,void * addr);
18
extern int ext2fs_clear_bit(unsigned int nr, void * addr);
37
STORAGE_CLASS int ext2fs_clear_bit(unsigned int nr, void * addr);
19
extern int ext2fs_test_bit(unsigned int nr, const void * addr);
38
STORAGE_CLASS int ext2fs_test_bit(unsigned int nr, const void * addr);
20
extern void ext2fs_fast_set_bit(unsigned int nr,void * addr);
39
STORAGE_CLASS void ext2fs_fast_set_bit(unsigned int nr,void * addr);
21
extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr);
40
STORAGE_CLASS void ext2fs_fast_clear_bit(unsigned int nr, void * addr);
22
extern __u16 ext2fs_swab16(__u16 val);
41
STORAGE_CLASS __u16 ext2fs_swab16(__u16 val);
23
extern __u32 ext2fs_swab32(__u32 val);
42
STORAGE_CLASS __u32 ext2fs_swab32(__u32 val);
24
extern __u64 ext2fs_swab64(__u64 val);
43
STORAGE_CLASS __u64 ext2fs_swab64(__u64 val);
25
44
26
#ifdef WORDS_BIGENDIAN
45
#ifdef WORDS_BIGENDIAN
27
#define ext2fs_cpu_to_le64(x) ext2fs_swab64((x))
46
#define ext2fs_cpu_to_le64(x) ext2fs_swab64((x))
Lines 62-122 extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, Link Here
62
extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
81
extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
63
				int code, unsigned long arg);
82
				int code, unsigned long arg);
64
83
65
extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
84
STORAGE_CLASS int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
66
extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
85
STORAGE_CLASS int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
67
				       blk_t block);
86
				       blk_t block);
68
extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
87
STORAGE_CLASS int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
69
88
70
extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
89
STORAGE_CLASS int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
71
extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
90
STORAGE_CLASS int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
72
				       ext2_ino_t inode);
91
				       ext2_ino_t inode);
73
extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
92
STORAGE_CLASS int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
74
93
75
extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
94
STORAGE_CLASS void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
76
					  blk_t block);
95
					  blk_t block);
77
extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
96
STORAGE_CLASS void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
78
					    blk_t block);
97
					    blk_t block);
79
extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
98
STORAGE_CLASS int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
80
					 blk_t block);
99
					 blk_t block);
81
100
82
extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
101
STORAGE_CLASS void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
83
					  ext2_ino_t inode);
102
					  ext2_ino_t inode);
84
extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
103
STORAGE_CLASS void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
85
					    ext2_ino_t inode);
104
					    ext2_ino_t inode);
86
extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
105
STORAGE_CLASS int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
87
					 ext2_ino_t inode);
106
					 ext2_ino_t inode);
88
extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
107
STORAGE_CLASS blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
89
extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
108
STORAGE_CLASS ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
90
extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
109
STORAGE_CLASS blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
91
extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
110
STORAGE_CLASS ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
92
111
93
extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
112
STORAGE_CLASS void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
94
					   blk_t block, int num);
113
					   blk_t block, int num);
95
extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
114
STORAGE_CLASS void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
96
					     blk_t block, int num);
115
					     blk_t block, int num);
97
extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
116
STORAGE_CLASS int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
98
					  blk_t block, int num);
117
					  blk_t block, int num);
99
extern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,
118
STORAGE_CLASS int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,
100
					  ino_t inode, int num);
119
					  ino_t inode, int num);
101
extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
120
STORAGE_CLASS void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
102
						blk_t block, int num);
121
						blk_t block, int num);
103
extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
122
STORAGE_CLASS void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
104
						  blk_t block, int num);
123
						  blk_t block, int num);
105
extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
124
STORAGE_CLASS int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
106
					       blk_t block, int num);
125
					       blk_t block, int num);
107
extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);
126
STORAGE_CLASS void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);
108
127
109
/* These routines moved to gen_bitmap.c */
128
/* These routines moved to gen_bitmap.c */
110
extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
129
STORAGE_CLASS int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
111
					 __u32 bitno);
130
					 __u32 bitno);
112
extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
131
STORAGE_CLASS int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
113
					   blk_t bitno);
132
					   blk_t bitno);
114
extern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
133
STORAGE_CLASS int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
115
				      blk_t bitno);
134
				      blk_t bitno);
116
extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
135
STORAGE_CLASS int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
117
					  blk_t block, int num);
136
					  blk_t block, int num);
118
extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);
137
STORAGE_CLASS __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);
119
extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);
138
STORAGE_CLASS __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);
120
139
121
/*
140
/*
122
 * The inline routines themselves...
141
 * The inline routines themselves...
Lines 134-150 extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap); Link Here
134
#endif
153
#endif
135
#endif /* NO_INLINE_FUNCS */
154
#endif /* NO_INLINE_FUNCS */
136
155
137
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
138
#ifdef INCLUDE_INLINE_FUNCS
139
#define _INLINE_ extern
140
#else
141
#ifdef __GNUC__
142
#define _INLINE_ extern __inline__
143
#else				/* For Watcom C */
144
#define _INLINE_ extern inline
145
#endif
146
#endif
147
148
/*
156
/*
149
 * Fast bit set/clear functions that doesn't need to return the
157
 * Fast bit set/clear functions that doesn't need to return the
150
 * previous bit value.
158
 * previous bit value.
Lines 423-428 _INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, Link Here
423
{
431
{
424
	ext2fs_unmark_block_bitmap_range(bitmap, block, num);
432
	ext2fs_unmark_block_bitmap_range(bitmap, block, num);
425
}
433
}
434
435
#undef STORAGE_CLASS
426
#undef _INLINE_
436
#undef _INLINE_
427
#endif
437
#endif
428
(-)a/lib/ext2fs/ext2fs.h (-27 / +38 lines)
Lines 241-247 struct struct_ext2_filsys { Link Here
241
#if EXT2_FLAT_INCLUDES
241
#if EXT2_FLAT_INCLUDES
242
#include "e2_bitops.h"
242
#include "e2_bitops.h"
243
#else
243
#else
244
#include <ext2fs/bitops.h>
244
#include "bitops.h"
245
#endif
245
#endif
246
246
247
/*
247
/*
Lines 1143-1192 extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list, Link Here
1143
				      unsigned int flags,
1143
				      unsigned int flags,
1144
				      FILE *f);
1144
				      FILE *f);
1145
1145
1146
1147
/* inline functions */
1148
extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr);
1149
extern errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr);
1150
extern errcode_t ext2fs_free_mem(void *ptr);
1151
extern errcode_t ext2fs_resize_mem(unsigned long old_size,
1152
				   unsigned long size, void *ptr);
1153
extern void ext2fs_mark_super_dirty(ext2_filsys fs);
1154
extern void ext2fs_mark_changed(ext2_filsys fs);
1155
extern int ext2fs_test_changed(ext2_filsys fs);
1156
extern void ext2fs_mark_valid(ext2_filsys fs);
1157
extern void ext2fs_unmark_valid(ext2_filsys fs);
1158
extern int ext2fs_test_valid(ext2_filsys fs);
1159
extern void ext2fs_mark_ib_dirty(ext2_filsys fs);
1160
extern void ext2fs_mark_bb_dirty(ext2_filsys fs);
1161
extern int ext2fs_test_ib_dirty(ext2_filsys fs);
1162
extern int ext2fs_test_bb_dirty(ext2_filsys fs);
1163
extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);
1164
extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino);
1165
extern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group);
1166
extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group);
1167
extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
1168
				      struct ext2_inode *inode);
1169
extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b);
1170
1171
/*
1146
/*
1172
 * The actual inlined functions definitions themselves...
1147
 * The actual inlined functions definitions themselves...
1173
 *
1148
 *
1174
 * If NO_INLINE_FUNCS is defined, then we won't try to do inline
1149
 * If NO_INLINE_FUNCS is defined, then we won't try to do inline
1175
 * functions at all!
1150
 * functions at all!
1176
 */
1151
 */
1152
#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__)
1153
#  define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */
1154
#endif
1155
#define STORAGE_CLASS extern
1177
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
1156
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
1178
#ifdef INCLUDE_INLINE_FUNCS
1157
#ifdef INCLUDE_INLINE_FUNCS
1179
#define _INLINE_ extern
1158
#define _INLINE_ extern
1180
#else
1159
#else
1181
#ifdef __GNUC__
1160
#if defined(__GNUC_GNU_INLINE__)
1182
#define _INLINE_ extern __inline__
1161
#define _INLINE_ extern __inline__
1162
#elif defined(__GNUC_STDC_INLINE__) || \
1163
    (defined(__STDC__) && __STDC_VERSION__ >= 199901L)
1164
#undef STORAGE_CLASS
1165
#define STORAGE_CLASS inline
1166
#define _INLINE_ inline
1183
#else				/* For Watcom C */
1167
#else				/* For Watcom C */
1184
#define _INLINE_ extern inline
1168
#define _INLINE_ extern inline
1185
#endif
1169
#endif
1186
#endif
1170
#endif
1187
1171
1172
/* inline functions */
1173
STORAGE_CLASS errcode_t ext2fs_get_mem(unsigned long size, void *ptr);
1174
STORAGE_CLASS errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr);
1175
STORAGE_CLASS errcode_t ext2fs_free_mem(void *ptr);
1176
STORAGE_CLASS errcode_t ext2fs_resize_mem(unsigned long old_size,
1177
       				   unsigned long size, void *ptr);
1178
STORAGE_CLASS void ext2fs_mark_super_dirty(ext2_filsys fs);
1179
STORAGE_CLASS void ext2fs_mark_changed(ext2_filsys fs);
1180
STORAGE_CLASS int ext2fs_test_changed(ext2_filsys fs);
1181
STORAGE_CLASS void ext2fs_mark_valid(ext2_filsys fs);
1182
STORAGE_CLASS void ext2fs_unmark_valid(ext2_filsys fs);
1183
STORAGE_CLASS int ext2fs_test_valid(ext2_filsys fs);
1184
STORAGE_CLASS void ext2fs_mark_ib_dirty(ext2_filsys fs);
1185
STORAGE_CLASS void ext2fs_mark_bb_dirty(ext2_filsys fs);
1186
STORAGE_CLASS int ext2fs_test_ib_dirty(ext2_filsys fs);
1187
STORAGE_CLASS int ext2fs_test_bb_dirty(ext2_filsys fs);
1188
STORAGE_CLASS int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);
1189
STORAGE_CLASS int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino);
1190
STORAGE_CLASS blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group);
1191
STORAGE_CLASS blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group);
1192
STORAGE_CLASS blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
1193
       				      struct ext2_inode *inode);
1194
STORAGE_CLASS unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b);
1195
1188
#ifndef EXT2_CUSTOM_MEMORY_ROUTINES
1196
#ifndef EXT2_CUSTOM_MEMORY_ROUTINES
1189
#include <string.h>
1197
#include <string.h>
1198
1190
/*
1199
/*
1191
 *  Allocate memory
1200
 *  Allocate memory
1192
 */
1201
 */
Lines 1374-1379 _INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b) Link Here
1374
		return 0;
1383
		return 0;
1375
	return ((a - 1) / b) + 1;
1384
	return ((a - 1) / b) + 1;
1376
}
1385
}
1386
1387
#undef STORAGE_CLASS
1377
#undef _INLINE_
1388
#undef _INLINE_
1378
#endif
1389
#endif
1379
1390

Return to bug 297243