From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <hughd@google.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linmiaohe@huawei.com>
Subject: [PATCH 4/4] shmem: include header file to declare swap_info
Date: Thu, 12 Aug 2021 20:03:50 +0800 [thread overview]
Message-ID: <20210812120350.49801-5-linmiaohe@huawei.com> (raw)
In-Reply-To: <20210812120350.49801-1-linmiaohe@huawei.com>
It's bad to extern swap_info[] in .c. Include corresponding header
file instead.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/shmem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index ccef5fad0049..b9cebf074367 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -38,6 +38,7 @@
#include <linux/hugetlb.h>
#include <linux/frontswap.h>
#include <linux/fs_parser.h>
+#include <linux/swapfile.h>
static struct vfsmount *shm_mnt;
@@ -1152,8 +1153,6 @@ static void shmem_evict_inode(struct inode *inode)
clear_inode(inode);
}
-extern struct swap_info_struct *swap_info[];
-
static int shmem_find_swap_entries(struct address_space *mapping,
pgoff_t start, unsigned int nr_entries,
struct page **entries, pgoff_t *indices,
--
2.23.0
prev parent reply other threads:[~2021-08-12 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 12:03 [PATCH 0/4] Cleanups for shmem Miaohe Lin
2021-08-12 12:03 ` [PATCH 1/4] shmem: remove unneeded variable ret Miaohe Lin
2021-08-12 12:03 ` [PATCH 2/4] shmem: remove unneeded header file Miaohe Lin
2021-08-12 12:03 ` [PATCH 3/4] shmem: remove unneeded function forward declaration Miaohe Lin
2021-08-12 12:03 ` Miaohe Lin [this message]
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=20210812120350.49801-5-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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