From patchwork Mon Sep 24 09:16:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17501 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id D30678214C; Mon, 24 Sep 2018 11:16:16 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="uX0+uogi"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id E36BC80D23 for ; Mon, 24 Sep 2018 11:16:13 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p5B34CCA4.dip0.t-ipconnect.de [91.52.204.164]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id EF32E110005; Mon, 24 Sep 2018 11:16:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1537780573; bh=BrYu7vgn4G5TvujkBPCvk0+YIv1MYQ+eZ3WqzjXa+XM=; h=From:To:Cc:Subject:Date:From; b=uX0+uogirPT6EQ34W1Ytc9KeiSAU8HU6zrrB3XfzEBuY6cHMJ6ng97Nocjxqrf967 gQJYiOrzJnFakzGX5RMqgnu+zfnV8/iHVyK9npn0p3GKvpNLXtb/d8WH8rJ5MmsuJN 2o6oATy8JZyGP/XG6JF41SAIbZIk2QwIEAMl5FAA= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 24 Sep 2018 11:16:08 +0200 Message-Id: <20180924091609.20794-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Subject: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix colliding redefinition of file_dentry X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Linux >=4.4.8 have the function file_dentry already defined while Linux 4.5 only got it with v4.5.2. Older stable kernel versions might also have gotten this function. Maintaining a full list of kernel versions which have this functionality is too much of a burden and thus the calls to this function are simply replaced with calls to a new private function batadv_file_dentry. Signed-off-by: Sven Eckelmann --- compat-include/linux/fs.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compat-include/linux/fs.h b/compat-include/linux/fs.h index 4d6bb1d7..e0d6f7c7 100644 --- a/compat-include/linux/fs.h +++ b/compat-include/linux/fs.h @@ -27,11 +27,20 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) -static inline struct dentry *file_dentry(const struct file *file) +static inline struct dentry *batadv_file_dentry(const struct file *file) { - return file->f_path.dentry; + struct dentry *dentry = file->f_path.dentry; + +#ifdef DCACHE_OP_REAL + if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) + return dentry->d_op->d_real(dentry, file_inode(file)); +#endif + + return dentry; } +#define file_dentry batadv_file_dentry + #endif /* < KERNEL_VERSION(4, 6, 0) */ #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */ From patchwork Mon Sep 24 09:16:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17502 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EB84F82FD1; Mon, 24 Sep 2018 11:16:19 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="XEt5tMSQ"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 260BC82F0D for ; Mon, 24 Sep 2018 11:16:17 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p5B34CCA4.dip0.t-ipconnect.de [91.52.204.164]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id F0B11110005; Mon, 24 Sep 2018 11:16:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1537780577; bh=Mezob6YG2AhgmS4qU9UEuRCCQ7Cy04QnQiuWljiTw4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEt5tMSQzjLcij6kQLeR0UFy+1MWTLWgfNJuSXkxdeXSczjP6EFXwkXqxs+BL4Ux8 DwSPeIO4Dkg7jgTUyMFBAgg6WXRxhyhYHWxdn9w9yXJsU8b5XwAVNAMHJ4i4SY3W4w CagMY3/2odULXMBEotDmtke3HwrMnMnPqz6rdrvo= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 24 Sep 2018 11:16:09 +0200 Message-Id: <20180924091609.20794-2-sven@narfation.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180924091609.20794-1-sven@narfation.org> References: <20180924091609.20794-1-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: Fix colliding redefinition of skb_postpush_rcsum X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Linux >=4.4.47 have the function skb_postpush_rcsum already and also v3.16 got it with v3.16.57. Even older stable kernel versions might also have gotten this function with a stable release. Maintaining a full list of kernel versions which have this functionality is too much of a burden and thus the calls to this function are simply replaced with calls to a new private function batadv_skb_postpush_rcsum. Reported-by: Andreas Ziegler Signed-off-by: Sven Eckelmann --- compat-include/linux/skbuff.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compat-include/linux/skbuff.h b/compat-include/linux/skbuff.h index 36e4d10d..376ea10b 100644 --- a/compat-include/linux/skbuff.h +++ b/compat-include/linux/skbuff.h @@ -45,16 +45,18 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, #endif /* < KERNEL_VERSION(4, 2, 0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 47) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) -static inline void skb_postpush_rcsum(struct sk_buff *skb, - const void *start, unsigned int len) +static inline void batadv_skb_postpush_rcsum(struct sk_buff *skb, + const void *start, unsigned int len) { if (skb->ip_summed == CHECKSUM_COMPLETE) skb->csum = csum_block_add(skb->csum, csum_partial(start, len, 0), 0); } +#define skb_postpush_rcsum batadv_skb_postpush_rcsum + #endif /* < KERNEL_VERSION(4, 5, 0) */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)