1d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes/*
2d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * Copyright (c) 2009, 2010 Jeff Mahoney <jeffm@suse.com>
3d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
4d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * All rights reserved.
5d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *
6d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * Redistribution and use in source and binary forms, with or without
7d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * modification, are permitted provided that the following conditions
8d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * are met:
9d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * 1. Redistributions of source code must retain the above copyright
10d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *    notice, this list of conditions and the following disclaimer.
11d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * 2. Redistributions in binary form must reproduce the above copyright
12d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *    notice, this list of conditions and the following disclaimer in the
13d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *    documentation and/or other materials provided with the distribution.
14d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * 3. The name of the author may not be used to endorse or promote products
15d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *    derived from this software without specific prior written permission.
16d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes *
17d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes */
28d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
29d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#include "defs.h"
30d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
31d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
32d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#include <linux/ioctl.h>
33d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#include <linux/fs.h>
34d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
35d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughestypedef struct {
36d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int op;
37d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int flags;
38d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int datalen;
39d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	void *data;
40d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes} struct_blkpg_ioctl_arg;
41d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
42d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#define BLKPG_DEVNAMELTH	64
43d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#define BLKPG_VOLNAMELTH	64
44d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughestypedef struct {
45d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int64_t start;			/* starting offset in bytes */
46d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int64_t length;			/* length in bytes */
47d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	int pno;			/* partition number */
48d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	char devname[BLKPG_DEVNAMELTH];	/* partition name, like sda5 or c0d1p2,
49d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes					   to be used in kernel messages */
50d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	char volname[BLKPG_VOLNAMELTH];	/* volume label */
51d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes} struct_blkpg_partition;
52d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
53d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes#define BLKTRACE_BDEV_SIZE      32
54d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughestypedef struct blk_user_trace_setup {
55d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	char name[BLKTRACE_BDEV_SIZE];	/* output */
56d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint16_t act_mask;		/* input */
57d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint32_t buf_size;		/* input */
58d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint32_t buf_nr;		/* input */
59d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint64_t start_lba;
60d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint64_t end_lba;
61d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes	uint32_t pid;
62d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes} struct_blk_user_trace_setup;
63d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughes
64d35df493b4e7684c50d2d2fa032ee3a7ac228009Elliott Hughesstruct_blkpg_partition mpers_target_var;
65