Some fixes for SRCU in the LinuxKPI.
- Make sure to use READ_ONCE() when deferring variables. - Remove superfluous zero initializer. MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
bd88e5f28f
commit
61d82b0794
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359726
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2015-2017 Mellanox Technologies, Ltd.
|
||||
* Copyright (c) 2015-2020 Mellanox Technologies, Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -29,13 +29,16 @@
|
||||
#ifndef _LINUX_SRCU_H_
|
||||
#define _LINUX_SRCU_H_
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
struct srcu_struct {
|
||||
};
|
||||
|
||||
#define srcu_dereference(ptr,srcu) ((__typeof(*(ptr)) *)(ptr))
|
||||
#define srcu_dereference(p, srcu) \
|
||||
((__typeof(*(p)) *)READ_ONCE(p))
|
||||
|
||||
#define DEFINE_STATIC_SRCU(name) \
|
||||
static struct srcu_struct name = {}
|
||||
static struct srcu_struct name
|
||||
|
||||
/* prototypes */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user