536911fb35b07d69f912dfce836ec735e18f2939
[cascardo/linux.git] / drivers / md / dm-bootcache.h
1 /*
2  * Copyright 2012 Google, Inc.
3  *
4  * This software is licensed under the terms of the GNU General Public
5  * License version 2, as published by the Free Software Foundation, and
6  * may be copied, distributed, and modified under those terms.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13
14 #ifndef DM_BOOTCACHE_H
15 #define DM_BOOTCACHE_H
16
17 #include <linux/types.h>
18
19 enum {  BOOTCACHE_MAGIC = 1651470196,
20         BOOTCACHE_VERSION = 2,
21         MAX_SIGNATURE = 256
22 };
23
24 struct bootcache_trace {
25         __u64   sector; /* Sector offset */
26         __u64   count;  /* Number of blocks traced */
27         __u64   ino;    /* Inode number of file */
28 };
29
30 struct bootcache_hdr {
31         __u64   sector;         /* Sector offset where header is stored */
32         __u32   magic;          /* Magic number */
33         __u32   version;        /* Verion of boot cache */
34         __u32   state;          /* Curent state */
35         __u32   num_trace_recs; /* Number of trace reords */
36         __u32   sectors_meta;   /* Size of trace data on disk in sectors*/
37         __u32   sectors_data;   /* Size of the data area in sectors*/
38         __u32   max_sectors;    /* Max sectors that can to read */
39         __u32   max_hw_sectors; /* Max hardware sectore that can be read */
40         char    date[12];       /* Date and time dm-bootcache was compiled */
41         char    time[12];
42         char    signature[MAX_SIGNATURE];
43 };
44
45 #endif