jffs2_fs_i.h 1.45 KB
Newer Older
1
/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
Linus Torvalds's avatar
Linus Torvalds committed
2 3 4 5 6 7 8 9 10

#ifndef _JFFS2_FS_I
#define _JFFS2_FS_I

#include <linux/version.h>
#include <linux/rbtree.h>
#include <asm/semaphore.h>

struct jffs2_inode_info {
11
	/* We need an internal mutex similar to inode->i_mutex.
Linus Torvalds's avatar
Linus Torvalds committed
12 13 14
	   Unfortunately, we can't used the existing one, because
	   either the GC would deadlock, or we'd have to release it
	   before letting GC proceed. Or we'd have to put ugliness
15
	   into the GC code so it didn't attempt to obtain the i_mutex
Linus Torvalds's avatar
Linus Torvalds committed
16 17 18 19 20 21 22 23 24 25 26 27
	   for the inode(s) which are already locked */
	struct semaphore sem;

	/* The highest (datanode) version number used for this ino */
	uint32_t highest_version;

	/* List of data fragments which make up the file */
	struct rb_root fragtree;

	/* There may be one datanode which isn't referenced by any of the
	   above fragments, if it contains a metadata update but no actual
	   data - or if this is a directory inode */
28
	/* This also holds the _only_ dnode for symlinks/device nodes,
Linus Torvalds's avatar
Linus Torvalds committed
29 30 31 32 33 34
	   etc. */
	struct jffs2_full_dnode *metadata;

	/* Directory entries */
	struct jffs2_full_dirent *dents;

35 36 37
	/* The target path if this is the inode of a symlink */
	unsigned char *target;

Linus Torvalds's avatar
Linus Torvalds committed
38 39 40 41 42 43 44 45 46 47 48 49 50
	/* Some stuff we just have to keep in-core at all times, for each inode. */
	struct jffs2_inode_cache *inocache;

	uint16_t flags;
	uint8_t usercompr;
#if !defined (__ECOS)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
	struct inode vfs_inode;
#endif
#endif
};

#endif /* _JFFS2_FS_I */