4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License version 2 for more details. A copy is
14 * included in the COPYING file that accompanied this code.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * Copyright (c) 2012, 2014, Intel Corporation.
26 * lustre/include/lustre/lustre_lfsck_user.h
28 * Lustre LFSCK userspace interfaces.
30 * Author: Fan, Yong <fan.yong@intel.com>
33 #ifndef _LUSTRE_LFSCK_USER_H
34 # define _LUSTRE_LFSCK_USER_H
35 # include <lustre/lustre_user.h>
37 enum lfsck_param_flags {
38 /* Reset LFSCK iterator position to the device beginning. */
44 /* Dryrun mode, only check without modification */
47 /* LFSCK runs on all targets. */
50 /* Broadcast the command to other MDTs. Only valid on the sponsor MDT */
51 LPF_BROADCAST = 0x0010,
53 /* Handle orphan OST-objects. */
54 LPF_OST_ORPHAN = 0x0020,
56 /* Create OST-object for dangling LOV EA. */
57 LPF_CREATE_OSTOBJ = 0x0040,
59 /* Create MDT-object for dangling name entry. */
60 LPF_CREATE_MDTOBJ = 0x0080,
64 /* For MDT and OST internal OSD consistency check/repair. */
65 LFSCK_TYPE_SCRUB = 0x0000,
67 /* For MDT-OST (layout, object) consistency check/repair. */
68 LFSCK_TYPE_LAYOUT = 0x0001,
70 /* For MDT (FID-in-dirent, linkEA) consistency check/repair. */
71 LFSCK_TYPE_NAMESPACE = 0x0004,
72 LFSCK_TYPES_SUPPORTED = (LFSCK_TYPE_SCRUB | LFSCK_TYPE_LAYOUT |
73 LFSCK_TYPE_NAMESPACE),
74 LFSCK_TYPES_DEF = LFSCK_TYPES_SUPPORTED,
75 LFSCK_TYPES_ALL = ((__u16)(~0))
78 #define LFSCK_VERSION_V1 1
79 #define LFSCK_VERSION_V2 2
81 #define LFSCK_SPEED_NO_LIMIT 0
82 #define LFSCK_SPEED_LIMIT_DEF LFSCK_SPEED_NO_LIMIT
83 #define LFSCK_ASYNC_WIN_DEFAULT 1024
84 #define LFSCK_ASYNC_WIN_MAX ((__u16)(~0))
86 enum lfsck_start_valid {
87 LSV_SPEED_LIMIT = 0x00000001,
88 LSV_ERROR_HANDLE = 0x00000002,
89 LSV_DRYRUN = 0x00000004,
90 LSV_ASYNC_WINDOWS = 0x00000008,
91 LSV_CREATE_OSTOBJ = 0x00000010,
92 LSV_CREATE_MDTOBJ = 0x00000020,
95 /* Arguments for starting lfsck. */
97 /* Which arguments are valid, see 'enum lfsck_start_valid'. */
100 /* How many items can be scanned at most per second. */
101 __u32 ls_speed_limit;
103 /* For compatibility between user space tools and kernel service. */
106 /* Which LFSCK components to be (have been) started. */
109 /* Flags for the LFSCK, see 'enum lfsck_param_flags'. */
112 /* The windows size for async requests pipeline. */
113 __u16 ls_async_windows;
119 __u16 ls_padding_1; /* For 64-bits aligned. */
123 #endif /* _LUSTRE_LFSCK_USER_H */