From ee930fffee469d076998274a2ca55e13dc1efb67 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 08:50:54 +0000
Subject: [PATCH] enable tun/tap/iptables
---
kernel/fs/squashfs/decompressor_multi_percpu.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/kernel/fs/squashfs/decompressor_multi_percpu.c b/kernel/fs/squashfs/decompressor_multi_percpu.c
index 6a73c4f..b881b92 100644
--- a/kernel/fs/squashfs/decompressor_multi_percpu.c
+++ b/kernel/fs/squashfs/decompressor_multi_percpu.c
@@ -1,16 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2013
* Phillip Lougher <phillip@squashfs.org.uk>
- *
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
*/
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/percpu.h>
#include <linux/buffer_head.h>
-#include <linux/locallock.h>
+#include <linux/local_lock.h>
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
@@ -23,10 +21,9 @@
*/
struct squashfs_stream {
- void *stream;
+ void *stream;
+ local_lock_t lock;
};
-
-static DEFINE_LOCAL_IRQ_LOCK(stream_lock);
void *squashfs_decompressor_create(struct squashfs_sb_info *msblk,
void *comp_opts)
@@ -46,6 +43,7 @@
err = PTR_ERR(stream->stream);
goto out;
}
+ local_lock_init(&stream->lock);
}
kfree(comp_opts);
@@ -77,20 +75,19 @@
}
}
-int squashfs_decompress(struct squashfs_sb_info *msblk, struct buffer_head **bh,
- int b, int offset, int length, struct squashfs_page_actor *output)
+int squashfs_decompress(struct squashfs_sb_info *msblk, struct bio *bio,
+ int offset, int length, struct squashfs_page_actor *output)
{
- struct squashfs_stream __percpu *percpu =
- (struct squashfs_stream __percpu *) msblk->stream;
struct squashfs_stream *stream;
int res;
- stream = get_locked_ptr(stream_lock, percpu);
+ local_lock(&msblk->stream->lock);
+ stream = this_cpu_ptr(msblk->stream);
- res = msblk->decompressor->decompress(msblk, stream->stream, bh, b,
- offset, length, output);
+ res = msblk->decompressor->decompress(msblk, stream->stream, bio,
+ offset, length, output);
- put_locked_ptr(stream_lock, stream);
+ local_unlock(&msblk->stream->lock);
if (res < 0)
ERROR("%s decompression failed, data probably corrupt\n",
--
Gitblit v1.6.2