From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbdJHQON (ORCPT ); Sun, 8 Oct 2017 12:14:13 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:50994 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbdJHQM2 (ORCPT ); Sun, 8 Oct 2017 12:12:28 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v98GBWgL001379 X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Andrew Morton , Ian Abbott , Ingo Molnar , Linus Torvalds , Masahiro Yamada Subject: [PATCH 02/12] radix-tree: split struct radix_tree_root to Date: Mon, 9 Oct 2017 01:10:03 +0900 Message-Id: <1507479013-5207-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507479013-5207-1-git-send-email-yamada.masahiro@socionext.com> References: <1507479013-5207-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The idea is similar to the separation of and . The users of radix tree typically embed struct radix_tree_root in their data structures, but those headers do not need to know anything about the other radix tree stuff like radix_tree_node, accessors. Including pulls in lots of bloat while struct radix_tree_root only depends on for gfp_t, and for __rcu. To reduce the header dependency, split struct radix_tree_root out to . Signed-off-by: Masahiro Yamada --- include/linux/radix-tree-root.h | 24 ++++++++++++++++++++++++ include/linux/radix-tree.h | 6 +----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 include/linux/radix-tree-root.h diff --git a/include/linux/radix-tree-root.h b/include/linux/radix-tree-root.h new file mode 100644 index 0000000..1726df0 --- /dev/null +++ b/include/linux/radix-tree-root.h @@ -0,0 +1,24 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, or (at + * your option) any later version. + * + * 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. + */ + +#ifndef _LINUX_RADIX_TREE_ROOT_H +#define _LINUX_RADIX_TREE_ROOT_H + +#include +#include + +struct radix_tree_root { + gfp_t gfp_mask; + struct radix_tree_node __rcu *rnode; +}; + +#endif /* _LINUX_RADIX_TREE_ROOT_H */ diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 6df7fa9..db3fb1d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -109,11 +110,6 @@ struct radix_tree_node { #define ROOT_IS_IDR ((__force gfp_t)(1 << __GFP_BITS_SHIFT)) #define ROOT_TAG_SHIFT (__GFP_BITS_SHIFT + 1) -struct radix_tree_root { - gfp_t gfp_mask; - struct radix_tree_node __rcu *rnode; -}; - #define RADIX_TREE_INIT(mask) { \ .gfp_mask = (mask), \ .rnode = NULL, \ -- 2.7.4