From e3e12f52b214121840b44c91de5b3e5af5d3eb84 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 06 Nov 2023 03:04:41 +0000 Subject: [PATCH] rk3568 rt init --- kernel/fs/squashfs/decompressor_multi_percpu.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/fs/squashfs/decompressor_multi_percpu.c b/kernel/fs/squashfs/decompressor_multi_percpu.c index 23a9c28..6a73c4f 100644 --- a/kernel/fs/squashfs/decompressor_multi_percpu.c +++ b/kernel/fs/squashfs/decompressor_multi_percpu.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/percpu.h> #include <linux/buffer_head.h> +#include <linux/locallock.h> #include "squashfs_fs.h" #include "squashfs_fs_sb.h" @@ -24,6 +25,8 @@ struct squashfs_stream { void *stream; }; + +static DEFINE_LOCAL_IRQ_LOCK(stream_lock); void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, void *comp_opts) @@ -79,10 +82,15 @@ { struct squashfs_stream __percpu *percpu = (struct squashfs_stream __percpu *) msblk->stream; - struct squashfs_stream *stream = get_cpu_ptr(percpu); - int res = msblk->decompressor->decompress(msblk, stream->stream, bh, b, - offset, length, output); - put_cpu_ptr(stream); + struct squashfs_stream *stream; + int res; + + stream = get_locked_ptr(stream_lock, percpu); + + res = msblk->decompressor->decompress(msblk, stream->stream, bh, b, + offset, length, output); + + put_locked_ptr(stream_lock, stream); if (res < 0) ERROR("%s decompression failed, data probably corrupt\n", -- Gitblit v1.6.2