Commit | Line | Data |
---|---|---|
306b0c95 | 1 | /* |
f1e3cfff | 2 | * Compressed RAM block device |
306b0c95 | 3 | * |
1130ebba | 4 | * Copyright (C) 2008, 2009, 2010 Nitin Gupta |
306b0c95 NG |
5 | * |
6 | * This code is released using a dual license strategy: BSD/GPL | |
7 | * You can choose the licence that better fits your requirements. | |
8 | * | |
9 | * Released under the terms of 3-clause BSD License | |
10 | * Released under the terms of GNU General Public License Version 2.0 | |
11 | * | |
12 | * Project home: http://compcache.googlecode.com | |
13 | */ | |
14 | ||
f1e3cfff NG |
15 | #ifndef _ZRAM_IOCTL_H_ |
16 | #define _ZRAM_IOCTL_H_ | |
306b0c95 | 17 | |
f1e3cfff NG |
18 | struct zram_ioctl_stats { |
19 | u64 disksize; /* disksize in bytes (user specifies in KB) */ | |
306b0c95 NG |
20 | u64 num_reads; /* failed + successful */ |
21 | u64 num_writes; /* --do-- */ | |
ef4ffb7a | 22 | u64 failed_reads; /* should NEVER! happen */ |
23 | u64 failed_writes; /* can happen when memory is too low */ | |
f1e3cfff | 24 | u64 invalid_io; /* non-page-aligned I/O requests */ |
6a907728 | 25 | u64 notify_free; /* no. of swap slot free notifications */ |
306b0c95 NG |
26 | u32 pages_zero; /* no. of zero filled pages */ |
27 | u32 good_compress_pct; /* no. of pages with compression ratio<=50% */ | |
28 | u32 pages_expand_pct; /* no. of incompressible pages */ | |
29 | u32 pages_stored; | |
30 | u32 pages_used; | |
31 | u64 orig_data_size; | |
32 | u64 compr_data_size; | |
33 | u64 mem_used_total; | |
306b0c95 NG |
34 | } __attribute__ ((packed, aligned(4))); |
35 | ||
f1e3cfff NG |
36 | #define ZRAMIO_SET_DISKSIZE_KB _IOW('z', 0, size_t) |
37 | #define ZRAMIO_GET_STATS _IOR('z', 1, struct zram_ioctl_stats) | |
38 | #define ZRAMIO_INIT _IO('z', 2) | |
39 | #define ZRAMIO_RESET _IO('z', 3) | |
306b0c95 NG |
40 | |
41 | #endif |