databuf bugfixes
[cor_2_6_31.git] / include / linux / shmem_fs.h
blobabff6c9b413c10c118e30dc537ea7b7f5e357c8d
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 spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
30 uid_t uid; /* Mount uid for root directory */
31 gid_t gid; /* Mount gid for root directory */
32 mode_t mode; /* Mount mode for root directory */
33 struct mempolicy *mpol; /* default memory policy for mappings */
36 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
38 return container_of(inode, struct shmem_inode_info, vfs_inode);
41 #ifdef CONFIG_TMPFS_POSIX_ACL
42 int shmem_permission(struct inode *, int);
43 int shmem_acl_init(struct inode *, struct inode *);
45 extern struct xattr_handler shmem_xattr_acl_access_handler;
46 extern struct xattr_handler shmem_xattr_acl_default_handler;
48 extern struct generic_acl_operations shmem_acl_ops;
50 #else
51 static inline int shmem_acl_init(struct inode *inode, struct inode *dir)
53 return 0;
55 #endif /* CONFIG_TMPFS_POSIX_ACL */
57 #endif