X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=linux%2Fllist.c;h=611ce4881a875691c1369f125d5a63cdbc60b70a;hb=03b8098d370c864422527024b24dd2c9339c74db;hp=ae5872b1df0c669fc8365ce1754d2a128651a890;hpb=b33fc8298f7e13226b9895abc57c9bfce5e3fa2d;p=bcachefs-tools-debian diff --git a/linux/llist.c b/linux/llist.c index ae5872b..611ce48 100644 --- a/linux/llist.c +++ b/linux/llist.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Lock-less NULL terminated single linked list * @@ -8,19 +9,6 @@ * * Copyright 2010,2011 Intel Corp. * Author: Huang Ying - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include @@ -41,7 +29,7 @@ bool llist_add_batch(struct llist_node *new_first, struct llist_node *new_last, struct llist_node *first; do { - new_last->next = first = ACCESS_ONCE(head->first); + new_last->next = first = READ_ONCE(head->first); } while (cmpxchg(&head->first, first, new_first) != first); return !first;