182d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris/****************************************************************************
282d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ****************************************************************************
382d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***
482d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   This header was automatically generated from a Linux kernel header
582d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   of the same name, to make information necessary for userspace to
682d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   call into the kernel available to libc.  It contains only constants,
782d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   structures, and macros generated from the original header, and thus,
882d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   contains no copyrightable information.
982d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***
1082d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   To edit the content of this header, modify the corresponding
1182d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   source file (e.g. under external/kernel-headers/original/) then
1282d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   run bionic/libc/kernel/tools/update_all.py
1382d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***
1482d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   Any manual change here will be lost the next time this script will
1582d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***   be run. You've been warned!
1682d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ***
1782d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ****************************************************************************
1882d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris ****************************************************************************/
19525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#ifndef _LINUX_FSMAP_H
20525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define _LINUX_FSMAP_H
2182d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#include <linux/types.h>
22525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferrisstruct fsmap {
23525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmr_device;
24525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmr_flags;
25525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmr_physical;
26525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmr_owner;
27525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmr_offset;
28525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmr_length;
29525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmr_reserved[3];
3082d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris};
31525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferrisstruct fsmap_head {
32525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmh_iflags;
33525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmh_oflags;
34525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmh_count;
35525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u32 fmh_entries;
36525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  __u64 fmh_reserved[6];
37525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  struct fsmap fmh_keys[2];
38525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris  struct fsmap fmh_recs[];
39525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris};
40525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMH_IF_VALID 0
41525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMH_OF_DEV_T 0x1
42525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_PREALLOC 0x1
43525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_ATTR_FORK 0x2
44525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_EXTENT_MAP 0x4
45525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_SHARED 0x8
46525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_SPECIAL_OWNER 0x10
47525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OF_LAST 0x20
48525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWNER(type,code) (((__u64) type << 32) | ((__u64) code & 0xFFFFFFFFULL))
49525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWNER_TYPE(owner) ((__u32) ((__u64) owner >> 32))
50525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWNER_CODE(owner) ((__u32) (((__u64) owner & 0xFFFFFFFFULL)))
51525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWN_FREE FMR_OWNER(0, 1)
52525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWN_UNKNOWN FMR_OWNER(0, 2)
53525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FMR_OWN_METADATA FMR_OWNER(0, 3)
54525ce914edf136d2bd02ac8c404d56c52e737f4dChristopher Ferris#define FS_IOC_GETFSMAP _IOWR('X', 59, struct fsmap_head)
5582d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#endif
56