4 #include <linux/swap.h>
5 #include <linux/mempolicy.h>
7 /* inode in-kernel data */
9 #define SHMEM_NR_DIRECT 16
11 #define TMPFS_SUPER_MAGIC 0x01021994
14 struct shmem_inode_info {
17 unsigned long alloced; /* data pages alloced to file */
18 unsigned long swapped; /* subtotal assigned to swap */
19 unsigned long next_index; /* highest alloced index + 1 */
20 struct shared_policy policy; /* NUMA memory alloc policy */
21 struct page *i_indirect; /* top indirect blocks page */
22 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */
23 struct list_head swaplist; /* chain of maybes on swap */
24 struct inode vfs_inode;
27 struct shmem_sb_info {
28 unsigned long max_blocks; /* How many blocks are allowed */
29 unsigned long free_blocks; /* How many are left for allocation */
30 unsigned long max_inodes; /* How many inodes are allowed */
31 unsigned long free_inodes; /* How many are left for allocation */
35 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
37 return container_of(inode, struct shmem_inode_info, vfs_inode);