| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2014 Sergey Senozhatsky. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or |
|---|
| 5 | | - * modify it under the terms of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation; either version |
|---|
| 7 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #ifndef _ZCOMP_H_ |
|---|
| 11 | 7 | #define _ZCOMP_H_ |
|---|
| 8 | +#include <linux/local_lock.h> |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | struct zcomp_strm { |
|---|
| 11 | + /* The members ->buffer and ->tfm are protected by ->lock. */ |
|---|
| 12 | + local_lock_t lock; |
|---|
| 14 | 13 | /* compression/decompression buffer */ |
|---|
| 15 | 14 | void *buffer; |
|---|
| 16 | 15 | struct crypto_comp *tfm; |
|---|
| .. | .. |
|---|
| 18 | 17 | |
|---|
| 19 | 18 | /* dynamic per-device compression frontend */ |
|---|
| 20 | 19 | struct zcomp { |
|---|
| 21 | | - struct zcomp_strm * __percpu *stream; |
|---|
| 20 | + struct zcomp_strm __percpu *stream; |
|---|
| 22 | 21 | const char *name; |
|---|
| 23 | 22 | struct hlist_node node; |
|---|
| 24 | 23 | }; |
|---|