Deleted Added
full compact
uipc_shm.c (324618) uipc_shm.c (327785)
1/*-
2 * Copyright (c) 2006, 2011 Robert N. M. Watson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 *
38 * (2) Add support for this file type to fstat(1).
39 *
40 * (3) Resource limits? Does this need its own resource limits or are the
41 * existing limits in mmap(2) sufficient?
42 */
43
44#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006, 2011 Robert N. M. Watson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 *
38 * (2) Add support for this file type to fstat(1).
39 *
40 * (3) Resource limits? Does this need its own resource limits or are the
41 * existing limits in mmap(2) sufficient?
42 */
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_shm.c 324618 2017-10-14 17:51:25Z markj $");
45__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_shm.c 327785 2018-01-10 20:39:26Z markj $");
46
47#include "opt_capsicum.h"
48#include "opt_ktrace.h"
49
50#include <sys/param.h>
51#include <sys/capsicum.h>
52#include <sys/conf.h>
53#include <sys/fcntl.h>

--- 389 unchanged lines hidden (view full) ---

443 if (base != 0) {
444 idx = OFF_TO_IDX(length);
445retry:
446 m = vm_page_lookup(object, idx);
447 if (m != NULL) {
448 if (vm_page_sleep_if_busy(m, "shmtrc"))
449 goto retry;
450 } else if (vm_pager_has_page(object, idx, NULL, NULL)) {
46
47#include "opt_capsicum.h"
48#include "opt_ktrace.h"
49
50#include <sys/param.h>
51#include <sys/capsicum.h>
52#include <sys/conf.h>
53#include <sys/fcntl.h>

--- 389 unchanged lines hidden (view full) ---

443 if (base != 0) {
444 idx = OFF_TO_IDX(length);
445retry:
446 m = vm_page_lookup(object, idx);
447 if (m != NULL) {
448 if (vm_page_sleep_if_busy(m, "shmtrc"))
449 goto retry;
450 } else if (vm_pager_has_page(object, idx, NULL, NULL)) {
451 m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL);
452 if (m == NULL) {
453 VM_OBJECT_WUNLOCK(object);
454 VM_WAIT;
455 VM_OBJECT_WLOCK(object);
451 m = vm_page_alloc(object, idx,
452 VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL);
453 if (m == NULL)
456 goto retry;
454 goto retry;
457 }
458 rv = vm_pager_get_pages(object, &m, 1, NULL,
459 NULL);
460 vm_page_lock(m);
461 if (rv == VM_PAGER_OK) {
462 vm_page_deactivate(m);
463 vm_page_unlock(m);
464 vm_page_xunbusy(m);
465 } else {

--- 638 unchanged lines hidden ---
455 rv = vm_pager_get_pages(object, &m, 1, NULL,
456 NULL);
457 vm_page_lock(m);
458 if (rv == VM_PAGER_OK) {
459 vm_page_deactivate(m);
460 vm_page_unlock(m);
461 vm_page_xunbusy(m);
462 } else {

--- 638 unchanged lines hidden ---