lkml.org 
[lkml]   [2009]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[RFC][PATCH 2/9] mm: Implement generic support for revoking a mapping.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
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


\
 
 \ /
  Last update: 2009-04-11 14:09    [W:0.493 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site