1 /* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */ 2 /* 3 * Copyright (C) 2018-2019 HUAWEI, Inc. 4 * http://www.huawei.com/ 5 * Created by Li Guifu <bluce.liguifu@huawei.com> 6 * with heavy changes by Gao Xiang <gaoxiang25@huawei.com> 7 */ 8 #ifndef __EROFS_INODE_H 9 #define __EROFS_INODE_H 10 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 16 #include "erofs/internal.h" 17 erofs_igrab(struct erofs_inode * inode)18static inline struct erofs_inode *erofs_igrab(struct erofs_inode *inode) 19 { 20 ++inode->i_count; 21 return inode; 22 } 23 24 u32 erofs_new_encode_dev(dev_t dev); 25 unsigned char erofs_mode_to_ftype(umode_t mode); 26 unsigned char erofs_ftype_to_dtype(unsigned int filetype); 27 void erofs_inode_manager_init(void); 28 void erofs_insert_ihash(struct erofs_inode *inode, dev_t dev, ino_t ino); 29 struct erofs_inode *erofs_iget(dev_t dev, ino_t ino); 30 struct erofs_inode *erofs_iget_by_nid(erofs_nid_t nid); 31 unsigned int erofs_iput(struct erofs_inode *inode); 32 erofs_nid_t erofs_lookupnid(struct erofs_inode *inode); 33 struct erofs_dentry *erofs_d_alloc(struct erofs_inode *parent, 34 const char *name); 35 int erofs_rebuild_dump_tree(struct erofs_inode *dir); 36 int erofs_init_empty_dir(struct erofs_inode *dir); 37 int __erofs_fill_inode(struct erofs_inode *inode, struct stat *st, 38 const char *path); 39 struct erofs_inode *erofs_new_inode(void); 40 struct erofs_inode *erofs_mkfs_build_tree_from_path(const char *path); 41 struct erofs_inode *erofs_mkfs_build_special_from_fd(int fd, const char *name); 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif 48