commit
affe543e3d
@ -3,10 +3,12 @@
|
|||||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "cas_cache.h"
|
||||||
#include "utils_gc.h"
|
#include "utils_gc.h"
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
|
|
||||||
#if defined (CAS_GARBAGE_COLLECTOR)
|
#if defined (CAS_GARBAGE_COLLECTOR)
|
||||||
|
|
||||||
struct cas_vfree_item {
|
struct cas_vfree_item {
|
||||||
struct llist_head list;
|
struct llist_head list;
|
||||||
struct work_struct ws;
|
struct work_struct ws;
|
||||||
@ -35,6 +37,9 @@ void cas_vfree(const void *addr)
|
|||||||
{
|
{
|
||||||
struct cas_vfree_item *item = this_cpu_ptr(&cas_vfree_item);
|
struct cas_vfree_item *item = this_cpu_ptr(&cas_vfree_item);
|
||||||
|
|
||||||
|
if (!addr)
|
||||||
|
return;
|
||||||
|
|
||||||
atomic_inc(&freed);
|
atomic_inc(&freed);
|
||||||
|
|
||||||
if (llist_add((struct llist_node *)addr, &item->list))
|
if (llist_add((struct llist_node *)addr, &item->list))
|
||||||
|
Loading…
Reference in New Issue
Block a user