diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/shmem_fs.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/linux/shmem_fs.h')
-rw-r--r-- | include/linux/shmem_fs.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 399be5ad2f99..aa08fa8fd79b 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -3,12 +3,15 @@ | |||
3 | 3 | ||
4 | #include <linux/swap.h> | 4 | #include <linux/swap.h> |
5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
6 | #include <linux/pagemap.h> | ||
6 | #include <linux/percpu_counter.h> | 7 | #include <linux/percpu_counter.h> |
7 | 8 | ||
8 | /* inode in-kernel data */ | 9 | /* inode in-kernel data */ |
9 | 10 | ||
10 | #define SHMEM_NR_DIRECT 16 | 11 | #define SHMEM_NR_DIRECT 16 |
11 | 12 | ||
13 | #define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t)) | ||
14 | |||
12 | struct shmem_inode_info { | 15 | struct shmem_inode_info { |
13 | spinlock_t lock; | 16 | spinlock_t lock; |
14 | unsigned long flags; | 17 | unsigned long flags; |
@@ -17,8 +20,12 @@ struct shmem_inode_info { | |||
17 | unsigned long next_index; /* highest alloced index + 1 */ | 20 | unsigned long next_index; /* highest alloced index + 1 */ |
18 | struct shared_policy policy; /* NUMA memory alloc policy */ | 21 | struct shared_policy policy; /* NUMA memory alloc policy */ |
19 | struct page *i_indirect; /* top indirect blocks page */ | 22 | struct page *i_indirect; /* top indirect blocks page */ |
20 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 23 | union { |
24 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | ||
25 | char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; | ||
26 | }; | ||
21 | struct list_head swaplist; /* chain of maybes on swap */ | 27 | struct list_head swaplist; /* chain of maybes on swap */ |
28 | struct list_head xattr_list; /* list of shmem_xattr */ | ||
22 | struct inode vfs_inode; | 29 | struct inode vfs_inode; |
23 | }; | 30 | }; |
24 | 31 | ||
@@ -39,7 +46,27 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
39 | return container_of(inode, struct shmem_inode_info, vfs_inode); | 46 | return container_of(inode, struct shmem_inode_info, vfs_inode); |
40 | } | 47 | } |
41 | 48 | ||
49 | /* | ||
50 | * Functions in mm/shmem.c called directly from elsewhere: | ||
51 | */ | ||
42 | extern int init_tmpfs(void); | 52 | extern int init_tmpfs(void); |
43 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 53 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
54 | extern struct file *shmem_file_setup(const char *name, | ||
55 | loff_t size, unsigned long flags); | ||
56 | extern int shmem_zero_setup(struct vm_area_struct *); | ||
57 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | ||
58 | extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, | ||
59 | pgoff_t index, gfp_t gfp_mask); | ||
60 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); | ||
61 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | ||
62 | extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | ||
63 | struct page **pagep, swp_entry_t *ent); | ||
64 | |||
65 | static inline struct page *shmem_read_mapping_page( | ||
66 | struct address_space *mapping, pgoff_t index) | ||
67 | { | ||
68 | return shmem_read_mapping_page_gfp(mapping, index, | ||
69 | mapping_gfp_mask(mapping)); | ||
70 | } | ||
44 | 71 | ||
45 | #endif | 72 | #endif |