1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * fs/epfs/main.c 4 * 5 * Copyright (c) 2022 Huawei Technologies Co., Ltd. 6 * Author: weilongping@huawei.com 7 * Create: 2022-06-10 8 */ 9 #include <linux/fs.h> 10 #include <linux/module.h> 11 #include <linux/slab.h> 12 13 #include "internal.h" 14 15 struct kmem_cache *epfs_inode_cachep; 16 epfs_init(void)17static int __init epfs_init(void) 18 { 19 int ret; 20 21 epfs_inode_cachep = 22 kmem_cache_create("epfs_inode_cache", 23 sizeof(struct epfs_inode_info), 0, 0, 24 NULL); 25 if (!epfs_inode_cachep) 26 return -ENOMEM; 27 ret = register_filesystem(&epfs_fs_type); 28 if (ret) 29 kmem_cache_destroy(epfs_inode_cachep); 30 return ret; 31 } 32 epfs_exit(void)33static void __exit epfs_exit(void) 34 { 35 unregister_filesystem(&epfs_fs_type); 36 kmem_cache_destroy(epfs_inode_cachep); 37 } 38 39 module_init(epfs_init) 40 module_exit(epfs_exit) 41 MODULE_DESCRIPTION("Enhanced Proxy File System for OpenHarmony"); 42 MODULE_AUTHOR("LongPing Wei weilongping@huawei.com"); 43 MODULE_LICENSE("GPL v2"); 44 MODULE_ALIAS_FS("epfs"); 45