From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751902AbeA3ABh (ORCPT ); Mon, 29 Jan 2018 19:01:37 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:52880 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbeA3ABg (ORCPT ); Mon, 29 Jan 2018 19:01:36 -0500 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Hugh Dickins , Andrea Arcangeli , Michal Hocko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , David Herrmann , Khalid Aziz , Andrew Morton , Mike Kravetz Subject: [PATCH 1/3] mm: hugetlbfs: move HUGETLBFS_I outside #ifdef CONFIG_HUGETLBFS Date: Mon, 29 Jan 2018 16:00:59 -0800 Message-Id: <20180130000101.7329-2-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180130000101.7329-1-mike.kravetz@oracle.com> References: <20180130000101.7329-1-mike.kravetz@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8789 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801290304 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HUGETLBFS_I will be referenced (but not used) in code outside #ifdef CONFIG_HUGETLBFS. Move the definition to prevent compiler errors. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 36fa6a2a82e3..222d2a329f14 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -9,6 +9,7 @@ #include #include #include +#include #include struct ctl_table; @@ -256,6 +257,21 @@ enum { HUGETLB_ANONHUGE_INODE = 2, }; +/* + * HUGETLBFS_I (and hugetlbfs_inode_info) referenced but not used by code + * outside #ifdef CONFIG_HUGETLBFS. Define here to prevent compiler errors. + */ +struct hugetlbfs_inode_info { + struct shared_policy policy; + struct inode vfs_inode; + unsigned int seals; +}; + +static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode) +{ + return container_of(inode, struct hugetlbfs_inode_info, vfs_inode); +} + #ifdef CONFIG_HUGETLBFS struct hugetlbfs_sb_info { long max_inodes; /* inodes allowed */ @@ -273,17 +289,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) return sb->s_fs_info; } -struct hugetlbfs_inode_info { - struct shared_policy policy; - struct inode vfs_inode; - unsigned int seals; -}; - -static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode) -{ - return container_of(inode, struct hugetlbfs_inode_info, vfs_inode); -} - extern const struct file_operations hugetlbfs_file_operations; extern const struct vm_operations_struct hugetlb_vm_ops; struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, -- 2.13.6