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