1 #ifndef _LUSTRE_ACCESS_LOG_H
2 # define _LUSTRE_ACCESS_LOG_H
4 #include <linux/types.h>
7 * This is due to us being out of kernel and the way the OpenSFS branch
11 # include <uapi/linux/lustre/lustre_user.h>
13 # include <linux/lustre/lustre_user.h>
16 enum ofd_access_flags {
17 OFD_ACCESS_READ = 0x1,
18 OFD_ACCESS_WRITE = 0x2,
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 */
34 /* The name of the subdirectory of devtmpfs (/dev) containing the
35 * control and access log char devices. */
36 #define LUSTRE_ACCESS_LOG_DIR_NAME "lustre-access-log"
39 LUSTRE_ACCESS_LOG_VERSION_1 = 0x00010000,
40 LUSTRE_ACCESS_LOG_TYPE_OFD = 0x1,
41 LUSTRE_ACCESS_LOG_NAME_SIZE = 128,
44 struct lustre_access_log_info_v1 {
45 __u32 lali_version; /* LUSTRE_ACCESS_LOG_VERSION_1 */
46 __u32 lali_type; /* LUSTRE_ACCESS_LOG_TYPE_OFD */
47 char lali_name[LUSTRE_ACCESS_LOG_NAME_SIZE]; /* obd_name */
49 __u32 lali_entry_size;
50 /* Underscore prefixed members are intended for test and debug
54 __u32 _lali_entry_space;
55 __u32 _lali_entry_count;
56 __u32 _lali_drop_count;
57 __u32 _lali_is_closed;
61 /* /dev/lustre-access-log/control ioctl: return lustre access log
62 * interface version. */
63 LUSTRE_ACCESS_LOG_IOCTL_VERSION = _IO('O', 0x81),
65 /* /dev/lustre-access-log/control ioctl: return device major
66 * used for access log devices. (The major is dynamically
67 * allocated during ofd module initialization. */
68 LUSTRE_ACCESS_LOG_IOCTL_MAJOR = _IO('O', 0x82),
70 /* /dev/lustre-access-log/control ioctl: get global control event
71 * count and store it into file private_data. */
72 LUSTRE_ACCESS_LOG_IOCTL_PRESCAN = _IO('O', 0x83),
74 /* /dev/lustre-access-log/OBDNAME ioctl: populate struct
75 * lustre_access_log_info_v1 for the current device. */
76 LUSTRE_ACCESS_LOG_IOCTL_INFO = _IOR('O', 0x84, struct lustre_access_log_info_v1),
79 #endif /* _LUSTRE_ACCESS_LOG_H */