1*6a54128fSAndroid Build Coastguard Worker /*
2*6a54128fSAndroid Build Coastguard Worker * bb_compat.c --- compatibility badblocks routines
3*6a54128fSAndroid Build Coastguard Worker *
4*6a54128fSAndroid Build Coastguard Worker * Copyright (C) 1997 Theodore Ts'o.
5*6a54128fSAndroid Build Coastguard Worker *
6*6a54128fSAndroid Build Coastguard Worker * %Begin-Header%
7*6a54128fSAndroid Build Coastguard Worker * This file may be redistributed under the terms of the GNU Library
8*6a54128fSAndroid Build Coastguard Worker * General Public License, version 2.
9*6a54128fSAndroid Build Coastguard Worker * %End-Header%
10*6a54128fSAndroid Build Coastguard Worker */
11*6a54128fSAndroid Build Coastguard Worker
12*6a54128fSAndroid Build Coastguard Worker #include "config.h"
13*6a54128fSAndroid Build Coastguard Worker #include <stdio.h>
14*6a54128fSAndroid Build Coastguard Worker #include <string.h>
15*6a54128fSAndroid Build Coastguard Worker #if HAVE_UNISTD_H
16*6a54128fSAndroid Build Coastguard Worker #include <unistd.h>
17*6a54128fSAndroid Build Coastguard Worker #endif
18*6a54128fSAndroid Build Coastguard Worker #include <fcntl.h>
19*6a54128fSAndroid Build Coastguard Worker #include <time.h>
20*6a54128fSAndroid Build Coastguard Worker #if HAVE_SYS_STAT_H
21*6a54128fSAndroid Build Coastguard Worker #include <sys/stat.h>
22*6a54128fSAndroid Build Coastguard Worker #endif
23*6a54128fSAndroid Build Coastguard Worker #if HAVE_SYS_TYPES_H
24*6a54128fSAndroid Build Coastguard Worker #include <sys/types.h>
25*6a54128fSAndroid Build Coastguard Worker #endif
26*6a54128fSAndroid Build Coastguard Worker
27*6a54128fSAndroid Build Coastguard Worker #include "ext2_fs.h"
28*6a54128fSAndroid Build Coastguard Worker #include "ext2fsP.h"
29*6a54128fSAndroid Build Coastguard Worker
badblocks_list_create(badblocks_list * ret,int size)30*6a54128fSAndroid Build Coastguard Worker errcode_t badblocks_list_create(badblocks_list *ret, int size)
31*6a54128fSAndroid Build Coastguard Worker {
32*6a54128fSAndroid Build Coastguard Worker return ext2fs_badblocks_list_create(ret, size);
33*6a54128fSAndroid Build Coastguard Worker }
34*6a54128fSAndroid Build Coastguard Worker
badblocks_list_free(badblocks_list bb)35*6a54128fSAndroid Build Coastguard Worker void badblocks_list_free(badblocks_list bb)
36*6a54128fSAndroid Build Coastguard Worker {
37*6a54128fSAndroid Build Coastguard Worker ext2fs_badblocks_list_free(bb);
38*6a54128fSAndroid Build Coastguard Worker }
39*6a54128fSAndroid Build Coastguard Worker
badblocks_list_add(badblocks_list bb,blk_t blk)40*6a54128fSAndroid Build Coastguard Worker errcode_t badblocks_list_add(badblocks_list bb, blk_t blk)
41*6a54128fSAndroid Build Coastguard Worker {
42*6a54128fSAndroid Build Coastguard Worker return ext2fs_badblocks_list_add(bb, blk);
43*6a54128fSAndroid Build Coastguard Worker }
44*6a54128fSAndroid Build Coastguard Worker
badblocks_list_test(badblocks_list bb,blk_t blk)45*6a54128fSAndroid Build Coastguard Worker int badblocks_list_test(badblocks_list bb, blk_t blk)
46*6a54128fSAndroid Build Coastguard Worker {
47*6a54128fSAndroid Build Coastguard Worker return ext2fs_badblocks_list_test(bb, blk);
48*6a54128fSAndroid Build Coastguard Worker }
49*6a54128fSAndroid Build Coastguard Worker
badblocks_list_iterate_begin(badblocks_list bb,badblocks_iterate * ret)50*6a54128fSAndroid Build Coastguard Worker errcode_t badblocks_list_iterate_begin(badblocks_list bb,
51*6a54128fSAndroid Build Coastguard Worker badblocks_iterate *ret)
52*6a54128fSAndroid Build Coastguard Worker {
53*6a54128fSAndroid Build Coastguard Worker return ext2fs_badblocks_list_iterate_begin(bb, ret);
54*6a54128fSAndroid Build Coastguard Worker }
55*6a54128fSAndroid Build Coastguard Worker
badblocks_list_iterate(badblocks_iterate iter,blk_t * blk)56*6a54128fSAndroid Build Coastguard Worker int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk)
57*6a54128fSAndroid Build Coastguard Worker {
58*6a54128fSAndroid Build Coastguard Worker return ext2fs_badblocks_list_iterate(iter, blk);
59*6a54128fSAndroid Build Coastguard Worker }
60*6a54128fSAndroid Build Coastguard Worker
badblocks_list_iterate_end(badblocks_iterate iter)61*6a54128fSAndroid Build Coastguard Worker void badblocks_list_iterate_end(badblocks_iterate iter)
62*6a54128fSAndroid Build Coastguard Worker {
63*6a54128fSAndroid Build Coastguard Worker ext2fs_badblocks_list_iterate_end(iter);
64*6a54128fSAndroid Build Coastguard Worker }
65