Commit | Line | Data |
---|---|---|
306b0c95 NG |
1 | /* |
2 | * Compressed RAM based swap device | |
3 | * | |
4 | * Copyright (C) 2008, 2009 Nitin Gupta | |
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 | ||
15 | #ifndef _RAMZSWAP_IOCTL_H_ | |
16 | #define _RAMZSWAP_IOCTL_H_ | |
17 | ||
18 | #define MAX_SWAP_NAME_LEN 128 | |
19 | ||
20 | struct ramzswap_ioctl_stats { | |
21 | char backing_swap_name[MAX_SWAP_NAME_LEN]; | |
22 | u64 memlimit; /* only applicable if backing swap present */ | |
23 | u64 disksize; /* user specified or equal to backing swap | |
24 | * size (if present) */ | |
25 | u64 num_reads; /* failed + successful */ | |
26 | u64 num_writes; /* --do-- */ | |
27 | u64 failed_reads; /* can happen when memory is too low */ | |
28 | u64 failed_writes; /* should NEVER! happen */ | |
29 | u64 invalid_io; /* non-swap I/O requests */ | |
30 | u32 pages_zero; /* no. of zero filled pages */ | |
31 | u32 good_compress_pct; /* no. of pages with compression ratio<=50% */ | |
32 | u32 pages_expand_pct; /* no. of incompressible pages */ | |
33 | u32 pages_stored; | |
34 | u32 pages_used; | |
35 | u64 orig_data_size; | |
36 | u64 compr_data_size; | |
37 | u64 mem_used_total; | |
38 | u64 bdev_num_reads; /* no. of reads on backing dev */ | |
39 | u64 bdev_num_writes; /* no. of writes on backing dev */ | |
40 | } __attribute__ ((packed, aligned(4))); | |
41 | ||
42 | #define RZSIO_SET_DISKSIZE_KB _IOW('z', 0, size_t) | |
43 | #define RZSIO_SET_MEMLIMIT_KB _IOW('z', 1, size_t) | |
44 | #define RZSIO_SET_BACKING_SWAP _IOW('z', 2, unsigned char[MAX_SWAP_NAME_LEN]) | |
45 | #define RZSIO_GET_STATS _IOR('z', 3, struct ramzswap_ioctl_stats) | |
46 | #define RZSIO_INIT _IO('z', 4) | |
47 | #define RZSIO_RESET _IO('z', 5) | |
48 | ||
49 | #endif |