X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=mm%2Futil.c;h=8c9b7d1e7c499828c429b93853af28e7299edcc1;hb=28ab35841ce0262b41074464d9fb6709bb26348f;hp=4ddb6e186dd5cff8768ccbc186c85b31f05fe2c0;hpb=a5698b3835f5990deef30fa5397cae563af3c68a;p=linux-2.6-microblaze.git diff --git a/mm/util.c b/mm/util.c index 4ddb6e186dd5..8c9b7d1e7c49 100644 --- a/mm/util.c +++ b/mm/util.c @@ -311,6 +311,18 @@ int vma_is_stack_for_current(struct vm_area_struct *vma) return (vma->vm_start <= KSTK_ESP(t) && vma->vm_end >= KSTK_ESP(t)); } +/* + * Change backing file, only valid to use during initial VMA setup. + */ +void vma_set_file(struct vm_area_struct *vma, struct file *file) +{ + /* Changing an anonymous vma with this is illegal */ + get_file(file); + swap(vma->vm_file, file); + fput(file); +} +EXPORT_SYMBOL(vma_set_file); + #ifndef STACK_RND_MASK #define STACK_RND_MASK (0x7ff >> (PAGE_SHIFT - 12)) /* 8MB of VA */ #endif