^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * JFFS2 -- Journalling Flash File System, Version 2.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright © 2001-2007 Red Hat, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Created by David Woodhouse <dwmw2@infradead.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * For licensing information, see the file 'LICENCE' in this directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifndef _JFFS2_FS_I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define _JFFS2_FS_I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/rbtree.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/posix_acl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct jffs2_inode_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /* We need an internal mutex similar to inode->i_mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Unfortunately, we can't used the existing one, because
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) either the GC would deadlock, or we'd have to release it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) before letting GC proceed. Or we'd have to put ugliness
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) into the GC code so it didn't attempt to obtain the i_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) for the inode(s) which are already locked */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct mutex sem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* The highest (datanode) version number used for this ino */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) uint32_t highest_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* List of data fragments which make up the file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct rb_root fragtree;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* There may be one datanode which isn't referenced by any of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) above fragments, if it contains a metadata update but no actual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) data - or if this is a directory inode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) /* This also holds the _only_ dnode for symlinks/device nodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) etc. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct jffs2_full_dnode *metadata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /* Directory entries */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct jffs2_full_dirent *dents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /* The target path if this is the inode of a symlink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned char *target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /* Some stuff we just have to keep in-core at all times, for each inode. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct jffs2_inode_cache *inocache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) uint16_t flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) uint8_t usercompr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct inode vfs_inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif /* _JFFS2_FS_I */