1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * fs/epfs/internal.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_INTERNAL_H__
10 #define __FS_EPFS_INTERNAL_H__
11 
12 #include <linux/fs.h>
13 #include <linux/mutex.h>
14 
15 #include "epfs.h"
16 
17 #define EPFS_SUPER_MAGIC 0x20220607
18 
19 struct epfs_inode_info {
20 	struct inode vfs_inode;
21 	struct file *origin_file;
22 	struct epfs_range *range;
23 	struct mutex lock;
24 };
25 
epfs_inode_to_private(struct inode *inode)26 static inline struct epfs_inode_info *epfs_inode_to_private(struct inode *inode)
27 {
28 	return container_of(inode, struct epfs_inode_info, vfs_inode);
29 }
30 
31 struct inode *epfs_iget(struct super_block *sb, bool is_dir);
32 extern const struct dentry_operations epfs_dops;
33 extern const struct file_operations epfs_dir_fops;
34 extern const struct file_operations epfs_file_fops;
35 extern struct file_system_type epfs_fs_type;
36 extern struct kmem_cache *epfs_inode_cachep;
37 
38 #endif // __FS_EPFS_INTERNAL_H__
39