aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0986d19be0b7..f0cdfd18db55 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -144,7 +144,8 @@ extern unsigned int kobjsize(const void *objp);
144 144
145#define VM_GROWSDOWN 0x00000100 /* general info on the segment */ 145#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
146#define VM_GROWSUP 0x00000200 146#define VM_GROWSUP 0x00000200
147#define VM_SHM 0x00000400 /* shared memory area, don't swap out */ 147#define VM_SHM 0x00000000 /* Means nothing: delete it later */
148#define VM_UNPAGED 0x00000400 /* Pages managed without map count */
148#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 149#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
149 150
150#define VM_EXECUTABLE 0x00001000 151#define VM_EXECUTABLE 0x00001000
@@ -157,7 +158,7 @@ extern unsigned int kobjsize(const void *objp);
157 158
158#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ 159#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
159#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ 160#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
160#define VM_RESERVED 0x00080000 /* Pages managed in a special way */ 161#define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */
161#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ 162#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
162#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
163#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
@@ -311,8 +312,6 @@ struct page {
311 312
312extern void FASTCALL(__page_cache_release(struct page *)); 313extern void FASTCALL(__page_cache_release(struct page *));
313 314
314#ifdef CONFIG_HUGETLB_PAGE
315
316static inline int page_count(struct page *page) 315static inline int page_count(struct page *page)
317{ 316{
318 if (PageCompound(page)) 317 if (PageCompound(page))
@@ -329,23 +328,6 @@ static inline void get_page(struct page *page)
329 328
330void put_page(struct page *page); 329void put_page(struct page *page);
331 330
332#else /* CONFIG_HUGETLB_PAGE */
333
334#define page_count(p) (atomic_read(&(p)->_count) + 1)
335
336static inline void get_page(struct page *page)
337{
338 atomic_inc(&page->_count);
339}
340
341static inline void put_page(struct page *page)
342{
343 if (put_page_testzero(page))
344 __page_cache_release(page);
345}
346
347#endif /* CONFIG_HUGETLB_PAGE */
348
349/* 331/*
350 * Multiple processes may "see" the same page. E.g. for untouched 332 * Multiple processes may "see" the same page. E.g. for untouched
351 * mappings of /dev/null, all processes see the same page full of 333 * mappings of /dev/null, all processes see the same page full of