From: john.hubbard@gmail.com
To: Peter Zijlstra <peterz@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH] refcount: restore kref_get and kref_put to non-GPL status
Date: Wed, 8 Mar 2017 01:25:49 -0800 [thread overview]
Message-ID: <20170308092549.28982-2-jhubbard@nvidia.com> (raw)
In-Reply-To: <20170308092549.28982-1-jhubbard@nvidia.com>
From: John Hubbard <jhubbard@nvidia.com>
Originally, kref_get and kref_put were available as
standard routines that even non-GPL device drivers
could use. However, as an unintended side effect of
the recent kref_*() upgrade[1], these calls are now
effectively GPL, because they get routed to the
new refcount_inc() and refcount_dec_and_test()
routines.
Make just those routines non-GPL, in order to restore
the original behavior--and to avoid forcing simple
users of krefs to re-implement atomic refcounting.
[1] commit 10383aea2f44 ("kref: Implement 'struct kref' using refcount_t")
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
lib/refcount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/refcount.c b/lib/refcount.c
index aa09ad3c30b0..6421a4930484 100644
--- a/lib/refcount.c
+++ b/lib/refcount.c
@@ -113,7 +113,7 @@ void refcount_inc(refcount_t *r)
{
WARN_ONCE(!refcount_inc_not_zero(r), "refcount_t: increment on 0; use-after-free.\n");
}
-EXPORT_SYMBOL_GPL(refcount_inc);
+EXPORT_SYMBOL(refcount_inc);
bool refcount_sub_and_test(unsigned int i, refcount_t *r)
{
@@ -152,7 +152,7 @@ bool refcount_dec_and_test(refcount_t *r)
{
return refcount_sub_and_test(1, r);
}
-EXPORT_SYMBOL_GPL(refcount_dec_and_test);
+EXPORT_SYMBOL(refcount_dec_and_test);
/*
* Similar to atomic_dec(), it will WARN on underflow and fail to decrement
--
2.12.0
next prev parent reply other threads:[~2017-03-08 9:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 9:25 [PATCH 0/1] refcount: restore kref_get and kref_put to non-GPL status john.hubbard
2017-03-08 9:25 ` john.hubbard [this message]
2017-03-08 9:50 ` [PATCH] " Greg Kroah-Hartman
2017-03-08 9:53 ` John Hubbard
2017-03-08 16:03 ` Christoph Hellwig
2017-03-08 9:48 ` [PATCH 0/1] " Greg Kroah-Hartman
2017-03-08 9:59 ` John Hubbard
2017-03-08 10:12 ` Greg Kroah-Hartman
2017-03-08 10:52 ` John Hubbard
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=20170308092549.28982-2-jhubbard@nvidia.com \
--to=john.hubbard@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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