fork.c (1aa77e716c6f2332f2d4664f747ff4eba731825b) | fork.c (9a10064f5625d5572c3626c1516e0bebc6c9fe9b) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/fork.c 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 */ 7 8/* --- 351 unchanged lines hidden (view full) --- 360 ASSERT_EXCLUSIVE_WRITER(orig->vm_file); 361 /* 362 * orig->shared.rb may be modified concurrently, but the clone 363 * will be reinitialized. 364 */ 365 *new = data_race(*orig); 366 INIT_LIST_HEAD(&new->anon_vma_chain); 367 new->vm_next = new->vm_prev = NULL; | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/fork.c 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 */ 7 8/* --- 351 unchanged lines hidden (view full) --- 360 ASSERT_EXCLUSIVE_WRITER(orig->vm_file); 361 /* 362 * orig->shared.rb may be modified concurrently, but the clone 363 * will be reinitialized. 364 */ 365 *new = data_race(*orig); 366 INIT_LIST_HEAD(&new->anon_vma_chain); 367 new->vm_next = new->vm_prev = NULL; |
368 dup_vma_anon_name(orig, new); |
|
368 } 369 return new; 370} 371 372void vm_area_free(struct vm_area_struct *vma) 373{ | 369 } 370 return new; 371} 372 373void vm_area_free(struct vm_area_struct *vma) 374{ |
375 free_vma_anon_name(vma); |
|
374 kmem_cache_free(vm_area_cachep, vma); 375} 376 377static void account_kernel_stack(struct task_struct *tsk, int account) 378{ 379 void *stack = task_stack_page(tsk); 380 struct vm_struct *vm = task_stack_vm_area(tsk); 381 --- 1169 unchanged lines hidden (view full) --- 1551 goto out; 1552 1553 tsk->files = newf; 1554 error = 0; 1555out: 1556 return error; 1557} 1558 | 376 kmem_cache_free(vm_area_cachep, vma); 377} 378 379static void account_kernel_stack(struct task_struct *tsk, int account) 380{ 381 void *stack = task_stack_page(tsk); 382 struct vm_struct *vm = task_stack_vm_area(tsk); 383 --- 1169 unchanged lines hidden (view full) --- 1553 goto out; 1554 1555 tsk->files = newf; 1556 error = 0; 1557out: 1558 return error; 1559} 1560 |
1561static int copy_io(unsigned long clone_flags, struct task_struct *tsk) 1562{ 1563#ifdef CONFIG_BLOCK 1564 struct io_context *ioc = current->io_context; 1565 struct io_context *new_ioc; 1566 1567 if (!ioc) 1568 return 0; 1569 /* 1570 * Share io context with parent, if CLONE_IO is set 1571 */ 1572 if (clone_flags & CLONE_IO) { 1573 ioc_task_link(ioc); 1574 tsk->io_context = ioc; 1575 } else if (ioprio_valid(ioc->ioprio)) { 1576 new_ioc = get_task_io_context(tsk, GFP_KERNEL, NUMA_NO_NODE); 1577 if (unlikely(!new_ioc)) 1578 return -ENOMEM; 1579 1580 new_ioc->ioprio = ioc->ioprio; 1581 put_io_context(new_ioc); 1582 } 1583#endif 1584 return 0; 1585} 1586 |
|
1559static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) 1560{ 1561 struct sighand_struct *sig; 1562 1563 if (clone_flags & CLONE_SIGHAND) { 1564 refcount_inc(¤t->sighand->count); 1565 return 0; 1566 } --- 1602 unchanged lines hidden --- | 1587static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) 1588{ 1589 struct sighand_struct *sig; 1590 1591 if (clone_flags & CLONE_SIGHAND) { 1592 refcount_inc(¤t->sighand->count); 1593 return 0; 1594 } --- 1602 unchanged lines hidden --- |