xref: /kernel/linux/linux-6.6/fs/epfs/epfs.h (revision 62306a36)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * fs/epfs/epfs.h
4 *
5 * Copyright (c) 2022 Huawei Technologies Co., Ltd.
6 * Author: weilongping@huawei.com
7 * Create: 2022-06-10
8 */
9#ifndef __FS_EPFS_H__
10#define __FS_EPFS_H__
11
12#include <linux/ioctl.h>
13#include <linux/printk.h>
14#include <linux/types.h>
15
16#define EPFS_MAX_RANGES 127
17
18struct __attribute__((__packed__)) epfs_range {
19	__u64 num;
20	__u64 reserved;
21	struct {
22		__u64 begin;
23		__u64 end;
24	} range[0];
25};
26
27#define EPFS_IOCTL_MAGIC 0x71
28#define IOC_SET_ORIGIN_FD _IOW(EPFS_IOCTL_MAGIC, 1, __s32)
29#define IOC_SET_EPFS_RANGE _IOW(EPFS_IOCTL_MAGIC, 2, struct epfs_range)
30#define EPFS_IOCTL_MAXNR 3
31
32#define EPFS_TAG "Epfs"
33
34#define epfs_err(fmt, ...)						\
35	pr_err("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__)
36#define epfs_info(fmt, ...)						\
37	pr_info("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__)
38#define epfs_warn(fmt, ...)						\
39	pr_warn("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__)
40#define epfs_debug(fmt, ...)						\
41	pr_debug("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__)
42
43#endif // __FS_EPFS_H__
44