• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <stdbool.h>
15 
16 #include "epfs.h"
17 
18 #define EPFS_SUPER_MAGIC 0x20220607
19 
20 struct epfs_inode_info {
21 	struct inode vfs_inode;
22 	struct file *origin_file;
23 	struct epfs_range *range;
24 	struct mutex lock;
25 };
26 
epfs_inode_to_private(struct inode * inode)27 static inline struct epfs_inode_info *epfs_inode_to_private(struct inode *inode)
28 {
29 	return container_of(inode, struct epfs_inode_info, vfs_inode);
30 }
31 
32 struct inode *epfs_iget(struct super_block *sb, bool is_dir);
33 extern const struct dentry_operations epfs_dops;
34 extern const struct file_operations epfs_dir_fops;
35 extern const struct file_operations epfs_file_fops;
36 extern struct file_system_type epfs_fs_type;
37 extern struct kmem_cache *epfs_inode_cachep;
38 
39 #endif // __FS_EPFS_INTERNAL_H__
40