diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
commit | bbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (patch) | |
tree | 12b2bb4202b05f6ae6a43c6ce830a0472043dbe5 /include/linux/mm.h | |
parent | 8e204874db000928e37199c2db82b7eb8966cc3c (diff) | |
parent | 5a9a43646cf709312d71eca71cef90ad802f28f9 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
isofs: Remove global fs lock
jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
mm/truncate.c: fix build for CONFIG_BLOCK not enabled
fs:update the NOTE of the file_operations structure
Remove dead code in dget_parent()
AFS: Fix silly characters in a comment
switch d_add_ci() to d_splice_alias() in "found negative" case as well
simplify gfs2_lookup()
jfs_lookup(): don't bother with . or ..
get rid of useless dget_parent() in btrfs rename() and link()
get rid of useless dget_parent() in fs/btrfs/ioctl.c
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
drivers: fix up various ->llseek() implementations
fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
Ext4: handle SEEK_HOLE/SEEK_DATA generically
Btrfs: implement our own ->llseek
fs: add SEEK_HOLE and SEEK_DATA flags
reiserfs: make reiserfs default to barrier=flush
...
Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
shrinker callout for the inode cache, that clashed with the xfs code to
start the periodic workers later.
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index c70a326b8f26..8a45ad22a170 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/range.h> | 15 | #include <linux/range.h> |
16 | #include <linux/pfn.h> | 16 | #include <linux/pfn.h> |
17 | #include <linux/bit_spinlock.h> | 17 | #include <linux/bit_spinlock.h> |
18 | #include <linux/shrinker.h> | ||
18 | 19 | ||
19 | struct mempolicy; | 20 | struct mempolicy; |
20 | struct anon_vma; | 21 | struct anon_vma; |
@@ -1121,44 +1122,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1121 | } | 1122 | } |
1122 | #endif | 1123 | #endif |
1123 | 1124 | ||
1124 | /* | ||
1125 | * This struct is used to pass information from page reclaim to the shrinkers. | ||
1126 | * We consolidate the values for easier extention later. | ||
1127 | */ | ||
1128 | struct shrink_control { | ||
1129 | gfp_t gfp_mask; | ||
1130 | |||
1131 | /* How many slab objects shrinker() should scan and try to reclaim */ | ||
1132 | unsigned long nr_to_scan; | ||
1133 | }; | ||
1134 | |||
1135 | /* | ||
1136 | * A callback you can register to apply pressure to ageable caches. | ||
1137 | * | ||
1138 | * 'sc' is passed shrink_control which includes a count 'nr_to_scan' | ||
1139 | * and a 'gfpmask'. It should look through the least-recently-used | ||
1140 | * 'nr_to_scan' entries and attempt to free them up. It should return | ||
1141 | * the number of objects which remain in the cache. If it returns -1, it means | ||
1142 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). | ||
1143 | * | ||
1144 | * The 'gfpmask' refers to the allocation we are currently trying to | ||
1145 | * fulfil. | ||
1146 | * | ||
1147 | * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is | ||
1148 | * querying the cache size, so a fastpath for that case is appropriate. | ||
1149 | */ | ||
1150 | struct shrinker { | ||
1151 | int (*shrink)(struct shrinker *, struct shrink_control *sc); | ||
1152 | int seeks; /* seeks to recreate an obj */ | ||
1153 | |||
1154 | /* These are for internal use */ | ||
1155 | struct list_head list; | ||
1156 | long nr; /* objs pending delete */ | ||
1157 | }; | ||
1158 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | ||
1159 | extern void register_shrinker(struct shrinker *); | ||
1160 | extern void unregister_shrinker(struct shrinker *); | ||
1161 | |||
1162 | int vma_wants_writenotify(struct vm_area_struct *vma); | 1125 | int vma_wants_writenotify(struct vm_area_struct *vma); |
1163 | 1126 | ||
1164 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, | 1127 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, |