From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: [RFC][PATCH 2/9] mm: Implement generic support for revoking a mapping. Date: Sat, 11 Apr 2009 05:05:23 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: , , , , Al Viro , Hugh Dickins , Tejun Heo , Alexey Dobriyan , Linus Torvalds , Alan Cox , Greg Kroah-Hartman To: Andrew Morton Return-path: In-Reply-To: (Eric W. Biederman's message of "Sat\, 11 Apr 2009 05\:01\:29 -0700") Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org Signed-off-by: Eric W. Biederman --- include/linux/mm.h | 2 ++ mm/memory.c | 9 +++++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 96d8342..3fcbb8e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -807,6 +807,8 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, extern int vmtruncate(struct inode * inode, loff_t offset); extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); + +extern struct vm_operations_struct revoked_vm_ops; extern void remap_file_mappings(struct file *file, struct vm_operations_struct *vm_ops); #ifdef CONFIG_MMU diff --git a/mm/memory.c b/mm/memory.c index dcd0a3c..f68c84e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2378,6 +2378,15 @@ out: spin_lock(&mapping->i_mmap_lock); } +static int revoked_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +{ + return VM_FAULT_SIGBUS; +} + +struct vm_operations_struct revoked_vm_ops = { + .fault = revoked_fault, +}; + void remap_file_mappings(struct file *file, struct vm_operations_struct *vm_ops) { /* After file->f_ops has been changed update the vmas */ -- 1.6.1.2.350.g88cc -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org