Skip to content

Commit

Permalink
mm: only include blk_types in swap.h if CONFIG_SWAP is enabled
Browse files Browse the repository at this point in the history
It's only needed for the CONFIG_SWAP-only use of bio_end_io_t.

Because CONFIG_SWAP implies CONFIG_BLOCK this will allow to drop some
ifdefs in blk_types.h.

Instead we'll need to add a few explicit includes that were implicit
before, though.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 1, 2016
1 parent 9f08217 commit be29796
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/staging/lustre/include/linux/lnet/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define __LNET_TYPES_H__

#include <linux/types.h>
#include <linux/bvec.h>

/** \addtogroup lnet
* @{
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/lustre/lustre/llite/rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/pagemap.h>
/* current_is_kswapd() */
#include <linux/swap.h>
#include <linux/bvec.h>

#define DEBUG_SUBSYSTEM S_LLITE

Expand Down
1 change: 1 addition & 0 deletions fs/ntfs/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/buffer_head.h>
#include <linux/writeback.h>
#include <linux/bit_spinlock.h>
#include <linux/bio.h>

#include "aops.h"
#include "attrib.h"
Expand Down
1 change: 1 addition & 0 deletions fs/ntfs/mft.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/buffer_head.h>
#include <linux/slab.h>
#include <linux/swap.h>
#include <linux/bio.h>

#include "attrib.h"
#include "aops.h"
Expand Down
1 change: 1 addition & 0 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/quotaops.h>
#include <linux/swap.h>
#include <linux/uio.h>
#include <linux/bio.h>

int reiserfs_commit_write(struct file *f, struct page *page,
unsigned from, unsigned to);
Expand Down
1 change: 1 addition & 0 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Copyright (C) 2006 Ingo Molnar <mingo@elte.hu>
*
*/
#include <linux/bvec.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/pagemap.h>
Expand Down
4 changes: 3 additions & 1 deletion include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <linux/fs.h>
#include <linux/atomic.h>
#include <linux/page-flags.h>
#include <linux/blk_types.h>
#include <asm/page.h>

struct notifier_block;
Expand Down Expand Up @@ -352,6 +351,9 @@ extern int kswapd_run(int nid);
extern void kswapd_stop(int nid);

#ifdef CONFIG_SWAP

#include <linux/blk_types.h> /* for bio_end_io_t */

/* linux/mm/page_io.c */
extern int swap_readpage(struct page *);
extern int swap_writepage(struct page *page, struct writeback_control *wbc);
Expand Down

0 comments on commit be29796

Please sign in to comment.