From: Winnie Chang <winnie.chang@cypress.com>
To: backports@vger.kernel.org
Cc: Chi-Hsien.Lin@cypress.com
Subject: [PATCH v2] patches: update lib-bucket_locks.patch for v4.18-rc1
Date: Mon, 10 Sep 2018 05:02:18 -0500 [thread overview]
Message-ID: <20180910100207.GA28327@aremote01.aus.cypress.com> (raw)
This patch do not apply to source code in v4.18-rc1 due to
commit ce91f6ee5b3b (mm: kvmalloc does not fallback to vmalloc for
incompatible gfp flags) so updating it.
Signed-off-by: Winnie Chang <winnie.chang@cypress.com>
---
patches/lib-bucket_locks.patch | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/patches/lib-bucket_locks.patch b/patches/lib-bucket_locks.patch
index 15eeda1..7a97ce3 100644
--- a/patches/lib-bucket_locks.patch
+++ b/patches/lib-bucket_locks.patch
@@ -1,8 +1,6 @@
-diff --git a/compat/lib-bucket_locks.c b/compat/lib-bucket_locks.c
-index 266a97c5708b..405b52ca5708 100644
--- a/compat/lib-bucket_locks.c
+++ b/compat/lib-bucket_locks.c
-@@ -30,10 +30,24 @@ int alloc_bucket_spinlocks(spinlock_t **
+@@ -31,7 +31,26 @@
}
if (sizeof(spinlock_t) != 0) {
@@ -18,12 +16,14 @@ index 266a97c5708b..405b52ca5708 100644
+ if (!tlocks)
+ tlocks = kmalloc_array(size, sizeof(spinlock_t),
+ gfp);
++#elif LINUX_VERSION_IS_LESS(4,18,0)
++ if (gfpflags_allow_blocking(gfp))
++ tlocks = kvmalloc(size * sizeof(spinlock_t), gfp);
++ else
++ tlocks = kmalloc_array(size, sizeof(spinlock_t), gfp);
+#else
- if (gfpflags_allow_blocking(gfp))
- tlocks = kvmalloc(size * sizeof(spinlock_t), gfp);
- else
- tlocks = kmalloc_array(size, sizeof(spinlock_t), gfp);
+ tlocks = kvmalloc_array(size, sizeof(spinlock_t), gfp);
+#endif
if (!tlocks)
return -ENOMEM;
- for (i = 0; i < size; i++)
+ for (i = 0; i < size; i++) {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next reply other threads:[~2018-09-10 14:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 10:02 Winnie Chang [this message]
2018-09-10 10:19 ` [PATCH v2] patches: update lib-bucket_locks.patch for v4.18-rc1 Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180910100207.GA28327@aremote01.aus.cypress.com \
--to=winnie.chang@cypress.com \
--cc=Chi-Hsien.Lin@cypress.com \
--cc=backports@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).