Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_access_log.h
1 #ifndef _LUSTRE_ACCESS_LOG_H
2 # define _LUSTRE_ACCESS_LOG_H
3
4 #include <linux/types.h>
5 #include <asm/ioctl.h>
6 /*
7  * This is due to us being out of kernel and the way the OpenSFS branch
8  * handles CFLAGS.
9  */
10 #ifdef __KERNEL__
11 # include <uapi/linux/lustre/lustre_user.h>
12 #else
13 # include <linux/lustre/lustre_user.h>
14 #endif
15
16 enum ofd_access_flags {
17         OFD_ACCESS_READ = 0x1,
18         OFD_ACCESS_WRITE = 0x2,
19 };
20
21 struct ofd_access_entry_v1 {
22         struct lu_fid   oae_parent_fid; /* 16 */
23         __u64           oae_begin; /* 24 */
24         __u64           oae_end; /* 32 */
25         __u64           oae_time; /* 40 */
26         __u32           oae_size; /* 44 */
27         __u32           oae_segment_count; /* 48 */
28         __u32           oae_flags; /* 52 enum ofd_access_flags */
29         __u32           oae_reserved1; /* 56 */
30         __u32           oae_reserved2; /* 60 */
31         __u32           oae_reserved3; /* 64 */
32 };
33
34 /* The name of the subdirectory of devtmpfs (/dev) containing the
35  * control and access log char devices.
36  */
37 #define LUSTRE_ACCESS_LOG_DIR_NAME "lustre-access-log"
38
39 enum {
40         LUSTRE_ACCESS_LOG_VERSION_1 = 0x00010000,
41         LUSTRE_ACCESS_LOG_TYPE_OFD = 0x1,
42         LUSTRE_ACCESS_LOG_NAME_SIZE = 128,
43 };
44
45 struct lustre_access_log_info_v1 {
46         __u32   lali_version; /* LUSTRE_ACCESS_LOG_VERSION_1 */
47         __u32   lali_type; /* LUSTRE_ACCESS_LOG_TYPE_OFD */
48         char    lali_name[LUSTRE_ACCESS_LOG_NAME_SIZE]; /* obd_name */
49         __u32   lali_log_size;
50         __u32   lali_entry_size;
51          /* underscore prefix members are for test and debug only */
52         __u32   _lali_head;
53         __u32   _lali_tail;
54         __u32   _lali_entry_space;
55         __u32   _lali_entry_count;
56         __u32   _lali_drop_count;
57         __u32   _lali_is_closed;
58 };
59
60 /* /dev/lustre-access-log/control ioctl: return lustre access log */
61 enum {
62         /* return lustre access log interface version. */
63         LUSTRE_ACCESS_LOG_IOCTL_VERSION = _IO('O', 0x81),
64
65         /* return device major used for access log devices.
66          * (Which is dynamically allocated during ofd module initialization.)
67          */
68         LUSTRE_ACCESS_LOG_IOCTL_MAJOR = _IO('O', 0x82),
69
70         /* og/control ioctl: get global control event
71          * count and store it into file private_data.
72          */
73         LUSTRE_ACCESS_LOG_IOCTL_PRESCAN = _IO('O', 0x83),
74
75         /* /dev/lustre-access-log/OBDNAME ioctl: populate struct
76          * lustre_access_log_info_v1 for the current device.
77          */
78         LUSTRE_ACCESS_LOG_IOCTL_INFO = _IOR('O', 0x84,
79                                             struct lustre_access_log_info_v1),
80
81         /* /dev/lustre-access-log/OBDNAME ioctl: only entries whose
82          * PFID MDT index is equal to arg will be added to the log. A
83          * value of 0xfffffffff ((__u32)-1) will disable filtering
84          * which is the default.  Added in V2.
85          */
86         LUSTRE_ACCESS_LOG_IOCTL_FILTER = _IOW('O', 0x85, __u32),
87 };
88
89 #endif /* _LUSTRE_ACCESS_LOG_H */