Merge gregkh@master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6.22.y-op.git] / include / linux / shmem_fs.h
blobc057f0b32318bdc40ea879086805e174db29c035
1 #ifndef __SHMEM_FS_H
2 #define __SHMEM_FS_H
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 {
12 spinlock_t lock;
13 unsigned long flags;
14 unsigned long alloced; /* data pages alloced to file */
15 unsigned long swapped; /* subtotal assigned to swap */
16 unsigned long next_index; /* highest alloced index + 1 */
17 struct shared_policy policy; /* NUMA memory alloc policy */
18 struct page *i_indirect; /* top indirect blocks page */
19 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */
20 struct list_head swaplist; /* chain of maybes on swap */
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 */
29 int policy; /* Default NUMA memory alloc policy */
30 nodemask_t policy_nodes; /* nodemask for preferred and bind */
31 spinlock_t stat_lock;
34 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
36 return container_of(inode, struct shmem_inode_info, vfs_inode);
39 #endif