4 #include <linux/swap.h>
6 /* inode in-kernel data */
8 #define SHMEM_NR_DIRECT 16
10 struct shmem_inode_info {
12 unsigned long next_index;
13 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */
14 struct page *i_indirect; /* indirect blocks */
15 unsigned long alloced; /* data pages allocated to file */
16 unsigned long swapped; /* subtotal assigned to swap */
18 struct list_head list;
19 struct inode vfs_inode;
22 struct shmem_sb_info {
23 unsigned long max_blocks; /* How many blocks are allowed */
24 unsigned long free_blocks; /* How many are left for allocation */
25 unsigned long max_inodes; /* How many inodes are allowed */
26 unsigned long free_inodes; /* How many are left for allocation */
30 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
32 return container_of(inode, struct shmem_inode_info, vfs_inode);