From df5d5489aed7ae9de007776e19350bd5aebbfea2 Mon Sep 17 00:00:00 2001 From: Zhihao Cheng Date: Mon, 11 Nov 2024 17:08:12 +0800 Subject: ubifs-utils: libubifs: Support some file operations Add some file operations, such as ubifs_lookup, ubifs_mkdir, etc., this is a preparation for recovering disconnected files or root dir in fsck. File writing operations are based on the journal subsystem, generated dirty data depends on a new commit in subsequent steps to update disk content. Signed-off-by: Zhihao Cheng Signed-off-by: David Oberhollenzer --- ubifs-utils/libubifs/misc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ubifs-utils/libubifs/misc.h') diff --git a/ubifs-utils/libubifs/misc.h b/ubifs-utils/libubifs/misc.h index 4b71806..1b4404f 100644 --- a/ubifs-utils/libubifs/misc.h +++ b/ubifs-utils/libubifs/misc.h @@ -69,6 +69,15 @@ ubifs_tnc_find_child(struct ubifs_znode *znode, int start) return NULL; } +/** + * ubifs_inode - get UBIFS inode information by VFS 'struct inode' object. + * @inode: the VFS 'struct inode' pointer + */ +static inline struct ubifs_inode *ubifs_inode(const struct inode *inode) +{ + return container_of(inode, struct ubifs_inode, vfs_inode); +} + /** * ubifs_wbuf_sync - synchronize write-buffer. * @wbuf: write-buffer to synchronize -- cgit v1.2.3