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.
37 #define LUSTRE_ACCESS_LOG_DIR_NAME "lustre-access-log"
40 LUSTRE_ACCESS_LOG_VERSION_1 = 0x00010000,
41 LUSTRE_ACCESS_LOG_TYPE_OFD = 0x1,
42 LUSTRE_ACCESS_LOG_NAME_SIZE = 128,
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 */
50 __u32 lali_entry_size;
51 /* underscore prefix members are for test and debug only */
54 __u32 _lali_entry_space;
55 __u32 _lali_entry_count;
56 __u32 _lali_drop_count;
57 __u32 _lali_is_closed;
60 /* /dev/lustre-access-log/control ioctl: return lustre access log */
62 /* return lustre access log interface version. */
63 LUSTRE_ACCESS_LOG_IOCTL_VERSION = _IO('O', 0x81),
65 /* return device major used for access log devices.
66 * (Which is dynamically allocated during ofd module initialization.)
68 LUSTRE_ACCESS_LOG_IOCTL_MAJOR = _IO('O', 0x82),
70 /* og/control ioctl: get global control event
71 * count and store it into file private_data.
73 LUSTRE_ACCESS_LOG_IOCTL_PRESCAN = _IO('O', 0x83),
75 /* /dev/lustre-access-log/OBDNAME ioctl: populate struct
76 * lustre_access_log_info_v1 for the current device.
78 LUSTRE_ACCESS_LOG_IOCTL_INFO = _IOR('O', 0x84,
79 struct lustre_access_log_info_v1),
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.
86 LUSTRE_ACCESS_LOG_IOCTL_FILTER = _IOW('O', 0x85, __u32),
89 #endif /* _LUSTRE_ACCESS_LOG_H */