4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library.
22 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Use is subject to license terms.
25 * Copyright (c) 2013, Intel Corporation.
28 * This file is part of Lustre, http://www.lustre.org/
30 * Author: Nathan Rutman <nathan.rutman@seagate.com>
32 * Kernel <-> userspace communication routines.
33 * The definitions below are used in the kernel and userspace.
36 #ifndef __UAPI_KERNELCOMM_H__
37 #define __UAPI_KERNELCOMM_H__
39 #include <linux/types.h>
41 /* KUC message header.
42 * All current and future KUC messages should use this header.
43 * To avoid having to include Lustre headers from libcfs, define this here.
47 __u8 kuc_transport; /* Each new Lustre feature should use a different
50 __u16 kuc_msgtype; /* Message type or opcode, transport-specific */
51 __u16 kuc_msglen; /* Including header */
52 } __attribute__((aligned(sizeof(__u64))));
54 #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE)
56 #define KUC_MAGIC 0x191C /*Lustre9etLinC */
58 /* kuc_msgtype values are defined in each transport */
59 enum kuc_transport_type {
60 KUC_TRANSPORT_GENERIC = 1,
61 KUC_TRANSPORT_HSM = 2,
62 KUC_TRANSPORT_CHANGELOG = 3,
65 enum kuc_generic_message_type {
69 /* KUC Broadcast Groups. This determines which userspace process hears which
70 * messages. Mutliple transports may be used within a group, or multiple
71 * groups may use the same transport. Broadcast
72 * groups need not be used if e.g. a UID is specified instead;
73 * use group 0 to signify unicast.
75 #define KUC_GRP_HSM 0x02
76 #define KUC_GRP_MAX KUC_GRP_HSM
78 #define LK_FLG_STOP 0x01
81 /* kernelcomm control structure, passed from userspace to kernel */
82 struct lustre_kernelcomm {
89 } __attribute__((packed));
91 #endif /* __UAPI_KERNELCOMM_H__ */