From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 3/3] backports: Add kvcalloc()
Date: Sat, 16 Nov 2019 19:36:23 +0100 [thread overview]
Message-ID: <20191116183623.8858-3-hauke@hauke-m.de> (raw)
In-Reply-To: <20191116183623.8858-1-hauke@hauke-m.de>
kvcalloc() was added in kernel commit 1c542f38ab8d ("mm: Introduce
kvcalloc()") and is now used by the fq header filers.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
backport/backport-include/linux/mm.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index b28156d3..8ff7d6a6 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -50,4 +50,12 @@ static inline void *kvzalloc(size_t size, gfp_t flags)
}
#endif
+#if LINUX_VERSION_IS_LESS(4,18,0)
+#define kvcalloc LINUX_BACKPORT(kvcalloc)
+static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
+{
+ return kvmalloc_array(n, size, flags | __GFP_ZERO);
+}
+#endif /* < 4.18 */
+
#endif /* __BACKPORT_MM_H */
--
2.20.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next prev parent reply other threads:[~2019-11-16 18:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-16 18:36 [PATCH 1/3] backports: Add return value to backport_pci_disable_link_state() Hauke Mehrtens
2019-11-16 18:36 ` [PATCH 2/3] backports: Adapt to changes to skb_get_hash_perturb() Hauke Mehrtens
2019-11-19 9:00 ` Johannes Berg
2019-11-16 18:36 ` Hauke Mehrtens [this message]
2019-11-19 8:59 ` [PATCH 3/3] backports: Add kvcalloc() Johannes Berg
2019-11-19 19:12 ` Hauke Mehrtens
2019-11-19 19:38 ` 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=20191116183623.8858-3-hauke@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=backports@vger.kernel.org \
--cc=johannes@sipsolutions.net \
/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).