~wb-munzinger/+junk/ocfs2-tools

« back to all changes in this revision

Viewing changes to fsck.ocfs2/include/util.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2009-11-05 07:59:29 UTC
  • mfrom: (1.1.8 upstream) (0.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091105075929-q0nlwa4pco86t5eb
Tags: 1.4.3-1
* New upstream release.
* Replace libreadline-dev Build-Depends by libreadline5-dev
  (Closes: #553819).
* Update to Standards-Version 3.8.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#define FSCK_CANCELED    32     /* Aborted with a signal or ^C */
38
38
#define FSCK_LIBRARY     128    /* Shared library error */
39
39
 
 
40
/* Managing the I/O cache */
 
41
enum o2fsck_cache_hint {
 
42
        O2FSCK_CACHE_MODE_NONE = 0,
 
43
        O2FSCK_CACHE_MODE_JOURNAL,      /* Enough of a cache to replay a
 
44
                                           journal */
 
45
        O2FSCK_CACHE_MODE_FULL,         /* Enough of a cache to recover the
 
46
                                           filesystem */
 
47
};
 
48
void o2fsck_init_cache(o2fsck_state *ost, enum o2fsck_cache_hint hint);
 
49
int o2fsck_worth_caching(int blocks_to_read);
 
50
void o2fsck_reset_blocks_cached(void);
 
51
 
40
52
void o2fsck_write_inode(o2fsck_state *ost, uint64_t blkno,
41
53
                        struct ocfs2_dinode *di);
42
54
void o2fsck_mark_cluster_allocated(o2fsck_state *ost, uint32_t cluster);
53
65
                                   errcode_t (*func)(ocfs2_filesys *fs,
54
66
                                                     struct ocfs2_dinode *di,
55
67
                                                     int slot));
 
68
 
 
69
/* How to abort but clean up the cluster state */
 
70
void o2fsck_abort(void);
 
71
 
 
72
/*
 
73
 * Wrap the ocfs2 bitmap functions to abort when errors are found.  They're
 
74
 * not supposed to fail, so we want to handle it.
 
75
 */
 
76
void __o2fsck_bitmap_set(ocfs2_bitmap *bitmap, uint64_t bitno, int *oldval,
 
77
                         const char *where);
 
78
void __o2fsck_bitmap_clear(ocfs2_bitmap *bitmap, uint64_t bitno, int *oldval,
 
79
                           const char *where);
 
80
 
 
81
/* These wrappers pass the caller into __o2fsck_bitmap_*() */
 
82
#define o2fsck_bitmap_set(_map, _bit, _old)                             \
 
83
        __o2fsck_bitmap_set((_map), (_bit), (_old), __FUNCTION__)
 
84
#define o2fsck_bitmap_clear(_map, _bit, _old)                           \
 
85
        __o2fsck_bitmap_clear((_map), (_bit), (_old), __FUNCTION__);
56
86
#endif /* __O2FSCK_UTIL_H__ */