| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Definitions for the 'struct ptr_ring' datastructure. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Michael S. Tsirkin <mst@redhat.com> |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Copyright (C) 2016 Red Hat, Inc. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 10 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 11 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 12 | | - * option) any later version. |
|---|
| 13 | 9 | * |
|---|
| 14 | 10 | * This is a limited-size FIFO maintaining pointers in FIFO order, with |
|---|
| 15 | 11 | * one CPU producing entries and another consuming entries from a FIFO. |
|---|
| .. | .. |
|---|
| 26 | 22 | #include <linux/cache.h> |
|---|
| 27 | 23 | #include <linux/types.h> |
|---|
| 28 | 24 | #include <linux/compiler.h> |
|---|
| 29 | | -#include <linux/cache.h> |
|---|
| 30 | 25 | #include <linux/slab.h> |
|---|
| 26 | +#include <linux/mm.h> |
|---|
| 31 | 27 | #include <asm/errno.h> |
|---|
| 32 | 28 | #endif |
|---|
| 33 | 29 | |
|---|
| .. | .. |
|---|
| 111 | 107 | return -ENOSPC; |
|---|
| 112 | 108 | |
|---|
| 113 | 109 | /* Make sure the pointer we are storing points to a valid data. */ |
|---|
| 114 | | - /* Pairs with smp_read_barrier_depends in __ptr_ring_consume. */ |
|---|
| 110 | + /* Pairs with the dependency ordering in __ptr_ring_consume. */ |
|---|
| 115 | 111 | smp_wmb(); |
|---|
| 116 | 112 | |
|---|
| 117 | 113 | WRITE_ONCE(r->queue[r->producer++], ptr); |
|---|