diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-04-11 08:10:01 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@aol.com> | 2019-08-03 11:18:30 +0800 |
commit | a17497f0844a51783a8efc3e62c5bba3c268336e (patch) | |
tree | 6c49522c586baf4ec812502ae8edb1a15ced9c48 /include | |
parent | 34f39023ef93e13fb8b66beeb5a7ad57c3935d4b (diff) | |
download | erofs-utils-a17497f0844a51783a8efc3e62c5bba3c268336e.tar.gz |
erofs-utils: introduce inode operations
This patch adds core inode and dentry operations
to build the target image.
Signed-off-by: Li Guifu <bluce.liguifu@huawei.com>
[ Gao Xiang: with heavy changes. ]
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/erofs/inode.h | 21 | ||||
-rw-r--r-- | include/erofs/internal.h | 8 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/erofs/inode.h b/include/erofs/inode.h new file mode 100644 index 0000000..43aee93 --- /dev/null +++ b/include/erofs/inode.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * erofs_utils/include/erofs/inode.h + * + * Copyright (C) 2018-2019 HUAWEI, Inc. + * http://www.huawei.com/ + * Created by Li Guifu <bluce.liguifu@huawei.com> + * with heavy changes by Gao Xiang <gaoxiang25@huawei.com> + */ +#ifndef __EROFS_INODE_H +#define __EROFS_INODE_H + +#include "erofs/internal.h" + +void erofs_inode_manager_init(void); +unsigned int erofs_iput(struct erofs_inode *inode); +erofs_nid_t erofs_lookupnid(struct erofs_inode *inode); +struct erofs_inode *erofs_mkfs_build_tree_from_path(struct erofs_inode *parent, + const char *path); + +#endif diff --git a/include/erofs/internal.h b/include/erofs/internal.h index 4789471..f4ca9ee 100644 --- a/include/erofs/internal.h +++ b/include/erofs/internal.h @@ -108,6 +108,14 @@ struct erofs_dentry { }; }; +static inline bool is_dot_dotdot(const char *name) +{ + if (name[0] != '.') + return false; + + return name[1] == '\0' || (name[1] == '.' && name[2] == '\0'); +} + #include <stdio.h> #include <string.h> |