Whamcloud - gitweb
LU-10308 misc: update Intel copyright messages for 2017
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_barrier_user.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,
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.
15
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
19  *
20  * GPL HEADER END
21  */
22 /*
23  * Copyright (c) 2017, Intel Corporation.
24  *
25  * lustre/include/lustre/lustre_barrier_user.h
26  *
27  * Lustre write barrier (on MDT) userspace interfaces.
28  *
29  * Author: Fan, Yong <fan.yong@intel.com>
30  */
31 #ifndef _LUSTRE_BARRIER_USER_H
32 # define _LUSTRE_BARRIER_USER_H
33
34 /*
35  * This is due to us being out of kernel and the way the OpenSFS branch
36  * handles CFLAGS.
37  */
38 #ifdef __KERNEL__
39 # include <uapi/linux/lustre/lustre_user.h>
40 #else
41 # include <linux/lustre/lustre_user.h>
42 #endif
43
44 #define BARRIER_VERSION_V1      1
45 #define BARRIER_TIMEOUT_DEFAULT 30
46
47 enum barrier_commands {
48         BC_FREEZE       = 1,
49         BC_THAW         = 2,
50         BC_STAT         = 3,
51         BC_RESCAN       = 4,
52 };
53
54 enum barrier_status {
55         BS_INIT         = 0,
56         BS_FREEZING_P1  = 1,
57         BS_FREEZING_P2  = 2,
58         BS_FROZEN       = 3,
59         BS_THAWING      = 4,
60         BS_THAWED       = 5,
61         BS_FAILED       = 6,
62         BS_EXPIRED      = 7,
63         BS_RESCAN       = 8,
64 };
65
66 struct barrier_ctl {
67         __u32   bc_version;
68         __u32   bc_cmd;
69         union {
70                 __s32   bc_timeout;
71                 __u32   bc_total;
72         };
73         union {
74                 __u32   bc_status;
75                 __u32   bc_absence;
76         };
77         char    bc_name[12];
78         __u32   bc_padding;
79 };
80
81 #endif /* _LUSTRE_BARRIER_USER_H */