162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * fs/epfs/epfs.h 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (c) 2022 Huawei Technologies Co., Ltd. 662306a36Sopenharmony_ci * Author: weilongping@huawei.com 762306a36Sopenharmony_ci * Create: 2022-06-10 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci#ifndef __FS_EPFS_H__ 1062306a36Sopenharmony_ci#define __FS_EPFS_H__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <linux/ioctl.h> 1362306a36Sopenharmony_ci#include <linux/printk.h> 1462306a36Sopenharmony_ci#include <linux/types.h> 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#define EPFS_MAX_RANGES 127 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_cistruct __attribute__((__packed__)) epfs_range { 1962306a36Sopenharmony_ci __u64 num; 2062306a36Sopenharmony_ci __u64 reserved; 2162306a36Sopenharmony_ci struct { 2262306a36Sopenharmony_ci __u64 begin; 2362306a36Sopenharmony_ci __u64 end; 2462306a36Sopenharmony_ci } range[0]; 2562306a36Sopenharmony_ci}; 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define EPFS_IOCTL_MAGIC 0x71 2862306a36Sopenharmony_ci#define IOC_SET_ORIGIN_FD _IOW(EPFS_IOCTL_MAGIC, 1, __s32) 2962306a36Sopenharmony_ci#define IOC_SET_EPFS_RANGE _IOW(EPFS_IOCTL_MAGIC, 2, struct epfs_range) 3062306a36Sopenharmony_ci#define EPFS_IOCTL_MAXNR 3 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#define EPFS_TAG "Epfs" 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define epfs_err(fmt, ...) \ 3562306a36Sopenharmony_ci pr_err("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__) 3662306a36Sopenharmony_ci#define epfs_info(fmt, ...) \ 3762306a36Sopenharmony_ci pr_info("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__) 3862306a36Sopenharmony_ci#define epfs_warn(fmt, ...) \ 3962306a36Sopenharmony_ci pr_warn("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__) 4062306a36Sopenharmony_ci#define epfs_debug(fmt, ...) \ 4162306a36Sopenharmony_ci pr_debug("%s:%s:%d: " fmt, EPFS_TAG, __func__, __LINE__, ##__VA_ARGS__) 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#endif // __FS_EPFS_H__ 44