Message ID | 1452936598-28619-1-git-send-email-sven@narfation.org (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <sven@narfation.org> Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Authentication-Results: open-mesh.org; dkim=pass reason="1024-bit key; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=Lqi30gVu; dkim-adsp=pass; dkim-atps=neutral Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 7444781B4A for <b.a.t.m.a.n@lists.open-mesh.org>; Sat, 16 Jan 2016 10:30:02 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C593C167FD0000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c1:67fd::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id A10131100E7; Sat, 16 Jan 2016 10:30:01 +0100 (CET) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=20121; t=1452936601; bh=1wl8Fvxxzem8OBTx7utCsuLnzVdCT/JctXf7tktFllE=; h=From:To:Cc:Subject:Date:From; b=Lqi30gVuoIzztZ6zytOQbBgUEIUv9HCqUfv3sFYLX0HuVeJbLcDIcjuZSvwZKeBHu q3UQkOvphAswMsRZfi5CNo4P2SXtXf3PfxaOrLPJ6zFCOyhb0iitKdwox7P+IRDA7A lSthVF8SVJ+IBiLKTr0U+Wo91VhrSh/MBhpvGBMw= From: Sven Eckelmann <sven@narfation.org> To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 16 Jan 2016 10:29:39 +0100 Message-Id: <1452936598-28619-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.7.0.rc3 Subject: [B.A.T.M.A.N.] [PATCH v6 01/20] batman-adv: Add compatibility code for kref_get_unless_zero X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n.lists.open-mesh.org> List-Unsubscribe: <https://lists.open-mesh.org/mm/options/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=unsubscribe> List-Archive: <http://lists.open-mesh.org/pipermail/b.a.t.m.a.n/> List-Post: <mailto:b.a.t.m.a.n@lists.open-mesh.org> List-Help: <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=help> List-Subscribe: <https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=subscribe> X-List-Received-Date: Sat, 16 Jan 2016 09:30:02 -0000 |
Commit Message
Sven Eckelmann
Jan. 16, 2016, 9:29 a.m. UTC
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v6:
- removed patches which are now applied in the branch next
- rebased remaining patches on the patch
"batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was
modified by Marek while he applied the patches (this unfortunately made
some of the remaining patches "hard" to apply)
v5:
- add hack which allows to compile against stable kernel like 3.2.44 which
also added the kref_get_unless_zero function
v4:
- fix function names in commit messages
- fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc
- add extra patch for batadv_claim_free_ref kerneldoc fix
- change the phrase "free it" in all *_free_ref/*_put functions to "release it"
v3:
- update copyright year
v2:
- split patchset into fixes and kref migration to make it easier when the
decision is made where each patch will be applied
compat-include/linux/kref.h | 46 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 compat-include/linux/kref.h
Comments
On Saturday, January 16, 2016 10:29:39 Sven Eckelmann wrote: > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > compat-include/linux/kref.h | 46 > +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 > insertions(+) > create mode 100644 compat-include/linux/kref.h Applied in revision c7387df. Thanks, Marek
On Saturday, January 16, 2016 10:29:43 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/bridge_loop_avoidance.c | 29 +++++++++++++++++++++++------ > net/batman-adv/types.h | 2 +- > 2 files changed, 24 insertions(+), 7 deletions(-) Applied in revision cda4d54. Thanks, Marek
On Saturday, January 16, 2016 10:29:44 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/bridge_loop_avoidance.c | 16 ++++++++++------ > net/batman-adv/types.h | 2 +- > 2 files changed, 11 insertions(+), 7 deletions(-) Applied in revision b7a53be. Thanks, Marek
On Saturday, January 16, 2016 10:29:45 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/network-coding.c | 21 +++++++++++++-------- > net/batman-adv/types.h | 2 +- > 2 files changed, 14 insertions(+), 9 deletions(-) Applied in revision a3e8d4b. Thanks, Marek
On Saturday, January 16, 2016 10:29:46 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/network-coding.c | 28 +++++++++++++++++++++------- > net/batman-adv/types.h | 2 +- > 2 files changed, 22 insertions(+), 8 deletions(-) Applied in revision 2d3c3d3. Thanks, Marek
On Saturday, January 16, 2016 10:29:48 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/main.c | 22 +++++++++++++++++----- > net/batman-adv/types.h | 2 +- > 2 files changed, 18 insertions(+), 6 deletions(-) Applied in revision dd62ee6. Thanks, Marek
On Saturday, January 16, 2016 10:29:50 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/translation-table.c | 26 +++++++++++++++++--------- > net/batman-adv/types.h | 2 +- > 2 files changed, 18 insertions(+), 10 deletions(-) Applied in revision d63fa57. Thanks, Marek
On Saturday, January 16, 2016 10:29:51 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/originator.c | 17 ++++++++++------- > net/batman-adv/types.h | 2 +- > 2 files changed, 11 insertions(+), 8 deletions(-) Applied in revision c12b7f8. Thanks, Marek
On Saturday, January 16, 2016 10:29:54 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/bat_iv_ogm.c | 4 ++-- > net/batman-adv/hard-interface.c | 20 +++++++++++++------- > net/batman-adv/hard-interface.h | 16 +++++++--------- > net/batman-adv/originator.c | 8 ++++---- > net/batman-adv/types.h | 2 +- > 5 files changed, 27 insertions(+), 23 deletions(-) Applied in revision 9fa8c05. Thanks, Marek
On Saturday, January 16, 2016 10:29:57 Sven Eckelmann wrote: > batman-adv uses a self-written reference implementation which is just based > on atomic_t. This is less obvious when reading the code than kref and > therefore increases the change that the reference counting will be missed. > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > --- > v6: > - removed patches which are now applied in the branch next > - rebased remaining patches on the patch > "batman-adv: Avoid recursive call_rcu for batadv_nc_node" which was > modified by Marek while he applied the patches (this unfortunately made > some of the remaining patches "hard" to apply) > v5: > - add hack which allows to compile against stable kernel like 3.2.44 which > also added the kref_get_unless_zero function > v4: > - fix function names in commit messages > - fix double whitespace in batadv_tt_orig_list_entry_release kerneldoc > - add extra patch for batadv_claim_free_ref kerneldoc fix > - change the phrase "free it" in all *_free_ref/*_put functions to "release > it" v3: > - update copyright year > v2: > - split patchset into fixes and kref migration to make it easier when the > decision is made where each patch will be applied > > net/batman-adv/translation-table.c | 60 > ++++++++++++++++++++++++++++++-------- > net/batman-adv/types.h | 2 +- > 2 files changed, 49 insertions(+), 13 deletions(-) Applied in revision b81bdae. Thanks, Marek
diff --git a/compat-include/linux/kref.h b/compat-include/linux/kref.h new file mode 100644 index 0000000..bb3442c --- /dev/null +++ b/compat-include/linux/kref.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2007-2016 B.A.T.M.A.N. contributors: + * + * Marek Lindner, Simon Wunderlich + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + * + * This file contains macros for maintaining compatibility with older versions + * of the Linux kernel. + */ + +#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_KREF_H_ +#define _NET_BATMAN_ADV_COMPAT_LINUX_KREF_H_ + +#include <linux/version.h> +#include_next <linux/kref.h> + +#include <linux/atomic.h> +#include <linux/kernel.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) + +/* some stable versions like Linux 3.2.44 also introduced this function + * and would therefore break the build because they trigger a redefinition + * of this function. Instead rename this function to be in the batadv_* + * namespace + */ +#define kref_get_unless_zero(__kref) batadv_kref_get_unless_zero(__kref) + +static inline int __must_check batadv_kref_get_unless_zero(struct kref *kref) +{ + return atomic_add_unless(&kref->refcount, 1, 0); +} + +#endif /* < KERNEL_VERSION(3, 8, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_KREF_H_ */