diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
commit | ccf18968b1bbc2fb117190a1984ac2a826dac228 (patch) | |
tree | 7bc8fbf5722aecf1e84fa50c31c657864cba1daa /include/linux/mm.h | |
parent | e91c021c487110386a07facd0396e6c3b7cf9c1f (diff) | |
parent | d99cf9d679a520d67f81d805b7cb91c68e1847f0 (diff) |
Merge ../torvalds-2.6/
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index a06a84d347fb..bc01fff3aa01 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -634,14 +634,38 @@ struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | |||
634 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 634 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
635 | #else | 635 | #else |
636 | #define shmem_nopage filemap_nopage | 636 | #define shmem_nopage filemap_nopage |
637 | #define shmem_lock(a, b, c) ({0;}) /* always in memory, no need to lock */ | 637 | |
638 | #define shmem_set_policy(a, b) (0) | 638 | static inline int shmem_lock(struct file *file, int lock, |
639 | #define shmem_get_policy(a, b) (NULL) | 639 | struct user_struct *user) |
640 | { | ||
641 | return 0; | ||
642 | } | ||
643 | |||
644 | static inline int shmem_set_policy(struct vm_area_struct *vma, | ||
645 | struct mempolicy *new) | ||
646 | { | ||
647 | return 0; | ||
648 | } | ||
649 | |||
650 | static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | ||
651 | unsigned long addr) | ||
652 | { | ||
653 | return NULL; | ||
654 | } | ||
640 | #endif | 655 | #endif |
641 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | 656 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); |
657 | extern int shmem_mmap(struct file *file, struct vm_area_struct *vma); | ||
642 | 658 | ||
643 | int shmem_zero_setup(struct vm_area_struct *); | 659 | int shmem_zero_setup(struct vm_area_struct *); |
644 | 660 | ||
661 | #ifndef CONFIG_MMU | ||
662 | extern unsigned long shmem_get_unmapped_area(struct file *file, | ||
663 | unsigned long addr, | ||
664 | unsigned long len, | ||
665 | unsigned long pgoff, | ||
666 | unsigned long flags); | ||
667 | #endif | ||
668 | |||
645 | static inline int can_do_mlock(void) | 669 | static inline int can_do_mlock(void) |
646 | { | 670 | { |
647 | if (capable(CAP_IPC_LOCK)) | 671 | if (capable(CAP_IPC_LOCK)) |
@@ -690,14 +714,31 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
690 | } | 714 | } |
691 | 715 | ||
692 | extern int vmtruncate(struct inode * inode, loff_t offset); | 716 | extern int vmtruncate(struct inode * inode, loff_t offset); |
717 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | ||
693 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); | 718 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); |
694 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); | 719 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); |
695 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); | ||
696 | 720 | ||
697 | static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) | 721 | #ifdef CONFIG_MMU |
722 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, | ||
723 | unsigned long address, int write_access); | ||
724 | |||
725 | static inline int handle_mm_fault(struct mm_struct *mm, | ||
726 | struct vm_area_struct *vma, unsigned long address, | ||
727 | int write_access) | ||
698 | { | 728 | { |
699 | return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE); | 729 | return __handle_mm_fault(mm, vma, address, write_access) & |
730 | (~VM_FAULT_WRITE); | ||
700 | } | 731 | } |
732 | #else | ||
733 | static inline int handle_mm_fault(struct mm_struct *mm, | ||
734 | struct vm_area_struct *vma, unsigned long address, | ||
735 | int write_access) | ||
736 | { | ||
737 | /* should never happen if there's no MMU */ | ||
738 | BUG(); | ||
739 | return VM_FAULT_SIGBUS; | ||
740 | } | ||
741 | #endif | ||
701 | 742 | ||
702 | extern int make_pages_present(unsigned long addr, unsigned long end); | 743 | extern int make_pages_present(unsigned long addr, unsigned long end); |
703 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 744 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
@@ -896,6 +937,8 @@ extern unsigned long do_brk(unsigned long, unsigned long); | |||
896 | /* filemap.c */ | 937 | /* filemap.c */ |
897 | extern unsigned long page_unuse(struct page *); | 938 | extern unsigned long page_unuse(struct page *); |
898 | extern void truncate_inode_pages(struct address_space *, loff_t); | 939 | extern void truncate_inode_pages(struct address_space *, loff_t); |
940 | extern void truncate_inode_pages_range(struct address_space *, | ||
941 | loff_t lstart, loff_t lend); | ||
899 | 942 | ||
900 | /* generic vm_area_ops exported for stackable file systems */ | 943 | /* generic vm_area_ops exported for stackable file systems */ |
901 | extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); | 944 | extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); |