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