Do not run mandoc for lintmanpages if MANPAGES is empty.
[netbsd-mini2440.git] / libexec / lfs_cleanerd / cleaner.h
blob7404fa5dc7b43bda6835e8c082a32433f082f7a2
1 #ifndef CLEANER_H_
2 #define CLEANER_H_
4 /*
5 * An abbreviated version of the SEGUSE data structure.
6 */
7 struct clfs_seguse {
8 u_int32_t nbytes;
9 u_int32_t nsums;
10 u_int32_t flags;
11 u_int64_t lastmod;
12 u_int64_t priority;
16 * The cleaner's view of the superblock data structure.
18 struct clfs {
19 struct dlfs lfs_dlfs; /* Leverage LFS lfs_* defines here */
21 /* Ifile */
22 int clfs_ifilefd; /* Ifile file descriptor */
23 struct uvnode *lfs_ivnode; /* Ifile vnode */
24 struct lfs_fhandle clfs_ifilefh; /* Ifile file handle */
26 /* Device */
27 int clfs_devfd; /* Device file descriptor */
28 struct uvnode *clfs_devvp; /* Device vnode */
29 char *clfs_dev; /* Name of device */
31 /* Cache of segment status */
32 struct clfs_seguse *clfs_segtab; /* Abbreviated seguse table */
33 struct clfs_seguse **clfs_segtabp; /* pointers to same */
35 /* Progress status */
36 int clfs_nactive; /* How many segments' blocks we have */
37 int clfs_onhold; /* If cleaning this fs is on hold */
41 * Fraction of the could-be-clean segments required to be clean.
43 #define BUSY_LIM 0.5
44 #define IDLE_LIM 0.9
46 __BEGIN_DECLS
48 /* lfs_cleanerd.c */
49 void pwarn(const char *, ...);
50 void calc_cb(struct clfs *, int, struct clfs_seguse *);
51 int clean_fs(struct clfs *, CLEANERINFO *);
52 void dlog(const char *, ...);
53 void handle_error(struct clfs **, int);
54 int init_fs(struct clfs *, char *);
55 int invalidate_segment(struct clfs *, int);
56 void lfs_ientry(IFILE **, struct clfs *, ino_t, struct ubuf **);
57 int load_segment(struct clfs *, int, BLOCK_INFO **, int *);
58 int needs_cleaning(struct clfs *, CLEANERINFO *);
59 int32_t parse_pseg(struct clfs *, daddr_t, BLOCK_INFO **, int *);
60 int reinit_fs(struct clfs *);
61 void reload_ifile(struct clfs *);
62 void toss_old_blocks(struct clfs *, BLOCK_INFO **, int *, int *);
64 /* cleansrv.c */
65 void check_control_socket(void);
66 void try_to_become_master(int, char **);
68 /* coalesce.c */
69 int log2int(int);
70 int clean_all_inodes(struct clfs *);
71 int fork_coalesce(struct clfs *);
73 __END_DECLS
75 #endif /* CLEANER_H_ */