From: Mike Kravetz <mike.kravetz@oracle.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: "Hugh Dickins" <hughd@google.com>,
"Andrea Arcangeli" <aarcange@redhat.com>,
"Michal Hocko" <mhocko@kernel.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"David Herrmann" <dh.herrmann@gmail.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Mike Kravetz" <mike.kravetz@oracle.com>
Subject: [RFC PATCH 1/3] mm: hugetlbfs: move HUGETLBFS_I outside #ifdef CONFIG_HUGETLBFS
Date: Wed, 8 Nov 2017 17:41:07 -0800 [thread overview]
Message-ID: <20171109014109.21077-2-mike.kravetz@oracle.com> (raw)
In-Reply-To: <20171109014109.21077-1-mike.kravetz@oracle.com>
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 <mike.kravetz@oracle.com>
---
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 128ef10902f3..f816ac29dee0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -8,6 +8,7 @@
#include <linux/cgroup.h>
#include <linux/list.h>
#include <linux/kref.h>
+#include <linux/mempolicy.h>
#include <asm/pgtable.h>
struct ctl_table;
@@ -261,6 +262,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 */
@@ -278,17 +294,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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-11-09 1:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 1:41 [RFC PATCH 0/3] restructure memfd code Mike Kravetz
2017-11-09 1:41 ` Mike Kravetz [this message]
2017-11-09 1:41 ` [RFC PATCH 2/3] mm: memfd: split out memfd for use by multiple filesystems Mike Kravetz
2017-11-09 1:41 ` [RFC PATCH 3/3] mm: memfd: remove memfd code from shmem files and use new memfd files Mike Kravetz
2017-11-20 10:28 ` [RFC PATCH 0/3] restructure memfd code Marc-André Lureau
2017-11-20 22:55 ` Mike Kravetz
2017-11-21 16:32 ` Khalid Aziz
2017-11-22 0:40 ` Mike Kravetz
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=20171109014109.21077-2-mike.kravetz@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dh.herrmann@gmail.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcandre.lureau@redhat.com \
--cc=mhocko@kernel.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;
as well as URLs for NNTP newsgroup(s).