Whamcloud - gitweb
LU-14641 osd-ldiskfs: write commit declaring improvement
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_scrub.h
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.gnu.org/licenses/gpl-2.0.html
19  *
20  * GPL HEADER END
21  */
22 /*
23  * Copyright (c) 2012, 2017, Intel Corporation.
24  */
25 /*
26  * lustre/osd-ldiskfs/osd_scrub.h
27  *
28  * Definitions and declarations for ldiskfs backend OI scrub.
29  *
30  * Author: Fan Yong <yong.fan@whamcloud.com>
31  */
32
33 #ifndef _OSD_SCRUB_H
34 # define _OSD_SCRUB_H
35
36 #include <lustre_scrub.h>
37 #include "osd_oi.h"
38
39 /* The flags here are only used inside OSD, NOT be visible by dump(). */
40 enum scrub_internal_flags {
41         /* This is a new formatted device. */
42         SIF_NO_HANDLE_OLD_FID   = 0x0001,
43 };
44
45 struct osd_iit_param {
46         struct super_block *sb;
47         struct buffer_head *bitmap;
48         ldiskfs_group_t bg;
49         __u32 gbase;
50         __u32 offset;
51         __u32 start;
52 };
53
54 struct osd_scrub {
55         struct lustre_scrub     os_scrub;
56         struct lvfs_run_ctxt    os_ctxt;
57         struct osd_idmap_cache  os_oic;
58         struct osd_iit_param    os_iit_param;
59
60         /* statistics for /lost+found are in ram only, it will be reset
61          * when each time the device remount. */
62
63         /* How many objects have been scanned during initial OI scrub. */
64         __u64                   os_lf_scanned;
65         /* How many objects have been repaired during initial OI scrub. */
66         __u64                   os_lf_repaired;
67         /* How many objects failed to be processed during initial OI scrub. */
68         __u64                   os_lf_failed;
69
70         __u64                   os_bad_oimap_count;
71         time64_t                os_bad_oimap_time;
72 };
73
74 #endif /* _OSD_SCRUB_H */