1 #ifndef __SHMEM_FS_H
2 #define __SHMEM_FS_H
3 
4 /* inode in-kernel data */
5 
6 #define SHMEM_NR_DIRECT 16
7 
8 /*
9  * A swap entry has to fit into a "unsigned long", as
10  * the entry is hidden in the "index" field of the
11  * swapper address space.
12  *
13  * We have to move it here, since not every user of fs.h is including
14  * mm.h, but mm.h is including fs.h via sched .h :-/
15  */
16 typedef struct {
17 	unsigned long val;
18 } swp_entry_t;
19 
20 struct shmem_inode_info {
21 	spinlock_t		lock;
22 	unsigned long		next_index;
23 	swp_entry_t		i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */
24 	void		      **i_indirect; /* indirect blocks */
25 	unsigned long		swapped;    /* data pages assigned to swap */
26 	unsigned long		flags;
27 	struct list_head	list;
28 	struct inode	       *inode;
29 };
30 
31 struct shmem_sb_info {
32 	unsigned long max_blocks;   /* How many blocks are allowed */
33 	unsigned long free_blocks;  /* How many are left for allocation */
34 	unsigned long max_inodes;   /* How many inodes are allowed */
35 	unsigned long free_inodes;  /* How many are left for allocation */
36 	spinlock_t    stat_lock;
37 };
38 
39 #define SHMEM_I(inode)  (&inode->u.shmem_i)
40 
41 #endif
42