Skip to content

Commit

Permalink
md: move lots of #include lines out of .h files and into .c
Browse files Browse the repository at this point in the history
This makes the includes more explicit, and is preparation for moving
md_k.h to drivers/md/md.h

Remove include/raid/md.h as its only remaining use was to #include
other files.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
neilbrown committed Mar 31, 2009
1 parent 9202295 commit bff6197
Show file tree
Hide file tree
Showing 23 changed files with 42 additions and 70 deletions.
2 changes: 1 addition & 1 deletion crypto/xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#define BH_TRACE 0
#include <linux/module.h>
#include <linux/raid/md.h>
#include <linux/raid/xor.h>
#include <linux/jiffies.h>
#include <asm/xor.h>

/* The xor routines to use. */
Expand Down
3 changes: 2 additions & 1 deletion drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* wait if count gets too high, wake when it drops to half.
*/

#include <linux/blkdev.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/slab.h>
Expand All @@ -26,7 +27,7 @@
#include <linux/file.h>
#include <linux/mount.h>
#include <linux/buffer_head.h>
#include <linux/raid/md.h>
#include <linux/raid/md_k.h>
#include "bitmap.h"

/* debug macros */
Expand Down
5 changes: 4 additions & 1 deletion drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
#define ModeShift 5

#define MaxFault 50
#include <linux/raid/md.h>
#include <linux/blkdev.h>
#include <linux/raid/md_u.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>


static void faulty_fail(struct bio *bio, int error)
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include <linux/blkdev.h>
#include <linux/raid/md_u.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>
#include "linear.h"

/*
Expand Down
2 changes: 0 additions & 2 deletions drivers/md/linear.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _LINEAR_H
#define _LINEAR_H

#include <linux/raid/md.h>

struct dev_info {
mdk_rdev_t *rdev;
sector_t num_sectors;
Expand Down
6 changes: 5 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
*/

#include <linux/kthread.h>
#include <linux/raid/md.h>
#include <linux/blkdev.h>
#include <linux/sysctl.h>
#include <linux/seq_file.h>
#include <linux/buffer_head.h> /* for invalidate_bdev */
#include <linux/poll.h>
#include <linux/ctype.h>
Expand All @@ -44,6 +45,9 @@
#include <linux/reboot.h>
#include <linux/file.h>
#include <linux/delay.h>
#include <linux/raid/md_k.h>
#include <linux/raid/md_p.h>
#include <linux/raid/md_u.h>
#include "bitmap.h"

#define DEBUG 0
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include <linux/blkdev.h>
#include <linux/raid/md_u.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>
#include "multipath.h"

#define MAX_WORK_PER_DISK 128
Expand Down
2 changes: 0 additions & 2 deletions drivers/md/multipath.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _MULTIPATH_H
#define _MULTIPATH_H

#include <linux/raid/md.h>

struct multipath_info {
mdk_rdev_t *rdev;
};
Expand Down
3 changes: 3 additions & 0 deletions drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include <linux/blkdev.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>
#include "raid0.h"

static void raid0_unplug(struct request_queue *q)
Expand Down
2 changes: 0 additions & 2 deletions drivers/md/raid0.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _RAID0_H
#define _RAID0_H

#include <linux/raid/md.h>

struct strip_zone
{
sector_t zone_start; /* Zone offset in md_dev (in sectors) */
Expand Down
5 changes: 4 additions & 1 deletion drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "dm-bio-list.h"
#include <linux/delay.h>
#include <linux/blkdev.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>
#include "dm-bio-list.h"
#include "raid1.h"
#include "bitmap.h"

Expand Down
2 changes: 0 additions & 2 deletions drivers/md/raid1.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _RAID1_H
#define _RAID1_H

#include <linux/raid/md.h>

typedef struct mirror_info mirror_info_t;

struct mirror_info {
Expand Down
5 changes: 4 additions & 1 deletion drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "dm-bio-list.h"
#include <linux/delay.h>
#include <linux/blkdev.h>
#include <linux/raid/md_k.h>
#include <linux/seq_file.h>
#include "dm-bio-list.h"
#include "raid10.h"
#include "bitmap.h"

Expand Down
2 changes: 0 additions & 2 deletions drivers/md/raid10.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _RAID10_H
#define _RAID10_H

#include <linux/raid/md.h>

typedef struct mirror_info mirror_info_t;

struct mirror_info {
Expand Down
8 changes: 6 additions & 2 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@
* miss any bits.
*/

#include <linux/blkdev.h>
#include <linux/raid/md_k.h>
#include <linux/kthread.h>
#include <linux/async_tx.h>
#include <linux/seq_file.h>
#include "raid5.h"
#include "raid6.h"
#include "bitmap.h"

Expand Down Expand Up @@ -1467,7 +1471,7 @@ static void copy_data(int frombio, struct bio *bio,

static void compute_parity6(struct stripe_head *sh, int method)
{
raid6_conf_t *conf = sh->raid_conf;
raid5_conf_t *conf = sh->raid_conf;
int i, pd_idx = sh->pd_idx, qd_idx, d0_idx, disks = sh->disks, count;
struct bio *chosen;
/**** FIX THIS: This could be very bad if disks is close to 256 ****/
Expand Down Expand Up @@ -2795,7 +2799,7 @@ static bool handle_stripe5(struct stripe_head *sh)

static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
{
raid6_conf_t *conf = sh->raid_conf;
raid5_conf_t *conf = sh->raid_conf;
int disks = sh->disks;
struct bio *return_bi = NULL;
int i, pd_idx = sh->pd_idx;
Expand Down
1 change: 0 additions & 1 deletion drivers/md/raid5.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef _RAID5_H
#define _RAID5_H

#include <linux/raid/md.h>
#include <linux/raid/xor.h>

/*
Expand Down
6 changes: 1 addition & 5 deletions drivers/md/raid6.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

/* Set to 1 to use kernel-wide empty_zero_page */
#define RAID6_USE_EMPTY_ZERO_PAGE 0

#include <linux/raid/md.h>
#include "raid5.h"

typedef raid5_conf_t raid6_conf_t; /* Same configuration */
#include <linux/blkdev.h>

/* Additional compute_parity mode -- updates the parity w/o LOCKING */
#define UPDATE_PARITY 4
Expand Down
2 changes: 1 addition & 1 deletion fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <linux/if.h>
#include <linux/if_bridge.h>
#include <linux/slab.h>
#include <linux/raid/md.h>
#include <linux/raid/md_u.h>
#include <linux/kd.h>
#include <linux/route.h>
#include <linux/in6.h>
Expand Down
39 changes: 0 additions & 39 deletions include/linux/raid/md.h

This file was deleted.

3 changes: 0 additions & 3 deletions include/linux/raid/md_k.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#ifndef _MD_K_H
#define _MD_K_H

/* and dm-bio-list.h is not under include/linux because.... ??? */
#include "../../../drivers/md/dm-bio-list.h"

#ifdef CONFIG_BLOCK

#define MaxSector (~(sector_t)0)
Expand Down
2 changes: 0 additions & 2 deletions include/linux/raid/xor.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _XOR_H
#define _XOR_H

#include <linux/raid/md.h>

#define MAX_XOR_BLOCKS 4

extern void xor_blocks(unsigned int count, unsigned int bytes,
Expand Down
1 change: 1 addition & 0 deletions init/do_mounts.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/syscalls.h>
#include <linux/unistd.h>
Expand Down
3 changes: 2 additions & 1 deletion init/do_mounts_md.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <linux/delay.h>
#include <linux/raid/md.h>
#include <linux/raid/md_u.h>
#include <linux/raid/md_p.h>

#include "do_mounts.h"

Expand Down

0 comments on commit bff6197

Please sign in to comment.