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