4 #include <linux/swap.h>
5 #include <linux/mempolicy.h>
7 /* inode in-kernel data */
9 #define SHMEM_NR_DIRECT 16
11 struct shmem_inode_info {
13 unsigned long next_index;
14 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */
15 struct page *i_indirect; /* indirect blocks */
16 unsigned long alloced; /* data pages allocated to file */
17 unsigned long swapped; /* subtotal assigned to swap */
19 struct shared_policy policy;
20 struct list_head list;
21 struct inode vfs_inode;
24 struct shmem_sb_info {
25 unsigned long max_blocks; /* How many blocks are allowed */
26 unsigned long free_blocks; /* How many are left for allocation */
27 unsigned long max_inodes; /* How many inodes are allowed */
28 unsigned long free_inodes; /* How many are left for allocation */
32 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
34 return container_of(inode, struct shmem_inode_info, vfs_inode);