VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / include / linux / shmem_fs.h
1 #ifndef __SHMEM_FS_H
2 #define __SHMEM_FS_H
3
4 #include <linux/swap.h>
5 #include <linux/mempolicy.h>
6
7 /* inode in-kernel data */
8
9 #define SHMEM_NR_DIRECT 16
10
11 #define TMPFS_SUPER_MAGIC       0x01021994
12
13
14 struct shmem_inode_info {
15         spinlock_t              lock;
16         unsigned long           next_index;
17         swp_entry_t             i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */
18         struct page            *i_indirect; /* indirect blocks */
19         unsigned long           alloced;    /* data pages allocated to file */
20         unsigned long           swapped;    /* subtotal assigned to swap */
21         unsigned long           flags;
22         struct shared_policy     policy;
23         struct list_head        list;
24         struct inode            vfs_inode;
25 };
26
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 */
32         spinlock_t    stat_lock;
33 };
34
35 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
36 {
37         return container_of(inode, struct shmem_inode_info, vfs_inode);
38 }
39
40 #endif