diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atapi.h | 26 | ||||
| -rw-r--r-- | include/linux/ide.h | 62 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 1 | ||||
| -rw-r--r-- | include/linux/raid/md.h | 1 | ||||
| -rw-r--r-- | include/linux/raid/md_k.h | 64 | ||||
| -rw-r--r-- | include/linux/raid/multipath.h | 31 | ||||
| -rw-r--r-- | include/linux/raid/raid1.h | 3 | ||||
| -rw-r--r-- | include/linux/raid/raid5.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 2 |
9 files changed, 85 insertions, 107 deletions
diff --git a/include/linux/atapi.h b/include/linux/atapi.h index 0ac305922e3a..806aa4e49146 100644 --- a/include/linux/atapi.h +++ b/include/linux/atapi.h @@ -74,15 +74,6 @@ struct atapi_packet_command { } s; }; -extern void atapi_init_pc(struct atapi_packet_command *pc); - -extern void atapi_discard_data(struct ata_device *, unsigned int); -extern void atapi_write_zeros(struct ata_device *, unsigned int); - -extern void atapi_read(struct ata_device *, u8 *, unsigned int); -extern void atapi_write(struct ata_device *, u8 *, unsigned int); - - /* * ATAPI Status Register. */ @@ -360,3 +351,20 @@ typedef struct atapi_request_sense { u8 sk_specific[2]; /* Sense Key Specific */ u8 pad[2]; /* Padding to 20 bytes */ } atapi_request_sense_result_t; + + +extern void atapi_init_pc(struct atapi_packet_command *pc); + +extern void atapi_discard_data(struct ata_device *, unsigned int); +extern void atapi_write_zeros(struct ata_device *, unsigned int); + +extern void atapi_read(struct ata_device *, u8 *, unsigned int); +extern void atapi_write(struct ata_device *, u8 *, unsigned int); + +typedef enum { + ide_wait, /* insert rq at end of list, and wait for it */ + ide_preempt, /* insert rq in front of current request */ + ide_end /* insert rq at end of list, but don't wait for it */ +} ide_action_t; + +extern int ide_do_drive_cmd(struct ata_device *, struct request *, ide_action_t); diff --git a/include/linux/ide.h b/include/linux/ide.h index 4076310675f8..7b9c5cce01cf 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1,5 +1,6 @@ #ifndef _IDE_H #define _IDE_H + /* * Copyright (C) 1994-2002 Linus Torvalds & authors */ @@ -57,15 +58,14 @@ typedef unsigned char byte; /* used everywhere */ */ #define ERROR_MAX 8 /* Max read/write errors per sector */ #define ERROR_RESET 3 /* Reset controller every 4th retry */ -#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ /* - * state flags + * State flags. */ #define DMA_PIO_RETRY 1 /* retrying in PIO */ /* - * Definitions for accessing IDE controller registers + * Definitions for accessing IDE controller registers. */ enum { @@ -192,23 +192,21 @@ typedef enum { * Structure to hold all information about the location of this port */ typedef struct hw_regs_s { - ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ - int irq; /* our irq number */ - int dma; /* our dma entry */ - ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ + ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ + int irq; /* our irq number */ + int dma; /* our dma entry */ + int (*ack_intr)(struct ata_channel *); /* acknowledge interrupt */ hwif_chipset_t chipset; } hw_regs_t; /* * Set up hw_regs_t structure before calling ide_register_hw (optional) */ -void ide_setup_ports(hw_regs_t *hw, - ide_ioreg_t base, - int *offsets, - ide_ioreg_t ctrl, - ide_ioreg_t intr, - ide_ack_intr_t *ack_intr, - int irq); +extern void ide_setup_ports(hw_regs_t *hw, + ide_ioreg_t base, int *offsets, + ide_ioreg_t ctrl, ide_ioreg_t intr, + int (*ack_intr)(struct ata_channel *), + int irq); #include <asm/ide.h> @@ -282,14 +280,10 @@ struct ata_device { unsigned int usage; /* current "open()" count for drive */ char type; /* distingiush different devices: disk, cdrom, tape, floppy, ... */ - /* NOTE: If we had proper separation between channel and host chip, we - * could move this to the channel and many sync problems would - * magically just go away. - */ - request_queue_t queue; /* per device request queue */ + request_queue_t queue; /* per device request queue */ struct request *rq; /* current request */ - unsigned long sleep; /* sleep until this time */ + unsigned long sleep; /* sleep until this time */ byte retry_pio; /* retrying dma capable host in pio */ byte state; /* retry state */ @@ -341,6 +335,7 @@ struct ata_device { void *driver_data; /* extra driver data */ devfs_handle_t de; /* directory for device */ + char driver_req[10]; /* requests specific driver */ int last_lun; /* last logical unit */ @@ -392,6 +387,7 @@ enum { enum { IDE_BUSY, /* awaiting an interrupt */ IDE_SLEEP, + IDE_PIO, /* PIO in progress */ IDE_DMA /* DMA in progress */ }; @@ -404,11 +400,15 @@ struct ata_channel { */ spinlock_t *lock; unsigned long *active; /* active processing request */ - ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */ + + /* FIXME: Only still used in PDC4030. Localize this code there by + * replacing with busy waits. + */ struct timer_list timer; /* failsafe timer */ ide_startstop_t (*expiry)(struct ata_device *, struct request *, unsigned long *); /* irq handler, if active */ unsigned long poll_timeout; /* timeout value during polled operations */ + struct ata_device *drive; /* last serviced drive */ @@ -508,8 +508,6 @@ struct ata_channel { extern int ide_register_hw(hw_regs_t *hw); extern void ide_unregister(struct ata_channel *); -struct ata_taskfile; - #define IDE_MAX_TAG 32 #ifdef CONFIG_BLK_DEV_IDE_TCQ @@ -605,8 +603,7 @@ extern int noautodma; #define DEVICE_NR(device) (minor(device) >> PARTN_BITS) #include <linux/blk.h> -extern int __ata_end_request(struct ata_device *, struct request *, int, unsigned int); - +extern int ata_end_request(struct ata_device *, struct request *, int, unsigned int); extern void ata_set_handler(struct ata_device *drive, ata_handler_t handler, unsigned long timeout, ata_expiry_t expiry); @@ -627,21 +624,10 @@ int ide_xlate_1024(kdev_t, int, int, const char *); struct ata_device *get_info_ptr(kdev_t i_rdev); /* - * "action" parameter type for ide_do_drive_cmd() below. - */ -typedef enum { - ide_wait, /* insert rq at end of list, and wait for it */ - ide_preempt, /* insert rq in front of current request */ - ide_end /* insert rq at end of list, but don't wait for it */ -} ide_action_t; - -/* * temporarily mapping a (possible) highmem bio for PIO transfer */ #define ide_rq_offset(rq) (((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9) -extern int ide_do_drive_cmd(struct ata_device *, struct request *, ide_action_t); - struct ata_taskfile { struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr hobfile; @@ -654,7 +640,6 @@ extern void ata_read(struct ata_device *, void *, unsigned int); extern void ata_write(struct ata_device *, void *, unsigned int); extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *, char *); -extern void ide_fix_driveid(struct hd_driveid *id); extern int ide_config_drive_speed(struct ata_device *, byte); extern byte eighty_ninty_three(struct ata_device *); @@ -803,13 +788,12 @@ extern spinlock_t ide_lock; #define DRIVE_LOCK(drive) ((drive)->queue.queue_lock) -extern int drive_is_ready(struct ata_device *drive); - /* Low level device access functions. */ extern void ata_select(struct ata_device *, unsigned long); extern void ata_mask(struct ata_device *); extern int ata_status(struct ata_device *, u8, u8); +extern int ata_status_irq(struct ata_device *drive); extern int ata_status_poll( struct ata_device *, u8, u8, unsigned long, struct request *rq); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6758bf742e0c..c1f391bf8f62 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -610,6 +610,7 @@ #define PCI_DEVICE_ID_PROMISE_20268 0x4d68 #define PCI_DEVICE_ID_PROMISE_20268R 0x6268 #define PCI_DEVICE_ID_PROMISE_20269 0x4d69 +#define PCI_DEVICE_ID_PROMISE_20271 0x6269 #define PCI_DEVICE_ID_PROMISE_20275 0x1275 #define PCI_DEVICE_ID_PROMISE_20276 0x5275 #define PCI_DEVICE_ID_PROMISE_5300 0x5300 diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 280092c6e95b..45aaf76dd768 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -75,7 +75,6 @@ extern mdk_thread_t * md_register_thread (void (*run) (void *data), extern void md_unregister_thread (mdk_thread_t *thread); extern void md_wakeup_thread(mdk_thread_t *thread); extern void md_interrupt_thread (mdk_thread_t *thread); -extern void md_update_sb (mddev_t *mddev); extern void md_done_sync(mddev_t *mddev, int blocks, int ok); extern void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors); extern int md_error (mddev_t *mddev, struct block_device *bdev); diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 2a9bbed805ad..12358bb23a99 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -25,13 +25,16 @@ #define MULTIPATH 7UL #define MAX_PERSONALITY 8UL +#define LEVEL_MULTIPATH (-4) +#define LEVEL_LINEAR (-1) + static inline int pers_to_level (int pers) { switch (pers) { - case MULTIPATH: return -4; + case MULTIPATH: return LEVEL_MULTIPATH; case HSM: return -3; case TRANSLUCENT: return -2; - case LINEAR: return -1; + case LINEAR: return LEVEL_LINEAR; case RAID0: return 0; case RAID1: return 1; case RAID5: return 5; @@ -43,10 +46,10 @@ static inline int pers_to_level (int pers) static inline int level_to_pers (int level) { switch (level) { - case -4: return MULTIPATH; + case LEVEL_MULTIPATH: return MULTIPATH; case -3: return HSM; case -2: return TRANSLUCENT; - case -1: return LINEAR; + case LEVEL_LINEAR: return LINEAR; case 0: return RAID0; case 1: return RAID1; case 4: @@ -140,11 +143,7 @@ static inline void mark_disk_nonsync(mdp_disk_t * d) struct mdk_rdev_s { struct list_head same_set; /* RAID devices within the same set */ - struct list_head all; /* all RAID devices */ - struct list_head pending; /* undetected RAID devices */ - kdev_t dev; /* Device number */ - kdev_t old_dev; /* "" when it was last imported */ unsigned long size; /* Device size (in blocks) */ mddev_t *mddev; /* RAID array if running */ unsigned long last_events; /* IO event timestamp */ @@ -157,7 +156,10 @@ struct mdk_rdev_s int alias_device; /* device alias to the same disk */ int faulty; /* if faulty do not issue IO requests */ + int in_sync; /* device is a full member of the array */ + int desc_nr; /* descriptor index in the superblock */ + int raid_disk; /* role of device in array */ }; typedef struct mdk_personality_s mdk_personality_t; @@ -167,11 +169,25 @@ struct mddev_s void *private; mdk_personality_t *pers; int __minor; - mdp_super_t *sb; struct list_head disks; int sb_dirty; int ro; + /* Superblock information */ + int major_version, + minor_version, + patch_version; + int persistent; + int chunk_size; + time_t ctime, utime; + int level, layout; + int raid_disks; + unsigned long state; + sector_t size; /* used size of component devices */ + __u64 events; + + char uuid[16]; + struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ unsigned long curr_resync; /* blocks scheduled */ unsigned long resync_mark; /* a recent timestamp */ @@ -186,7 +202,11 @@ struct mddev_s int in_sync; /* know to not need resync */ struct semaphore reconfig_sem; atomic_t active; - mdp_disk_t *spare; + mdk_rdev_t *spare; + + int degraded; /* whether md should consider + * adding a spare + */ atomic_t recovery_active; /* blocks scheduled, but not written */ wait_queue_head_t recovery_wait; @@ -204,11 +224,11 @@ struct mdk_personality_s int (*stop)(mddev_t *mddev); int (*status)(char *page, mddev_t *mddev); int (*error_handler)(mddev_t *mddev, struct block_device *bdev); - int (*hot_add_disk) (mddev_t *mddev, mdp_disk_t *descriptor, mdk_rdev_t *rdev); + int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); int (*hot_remove_disk) (mddev_t *mddev, int number); - int (*spare_write) (mddev_t *mddev, int number); + int (*spare_write) (mddev_t *mddev); int (*spare_inactive) (mddev_t *mddev); - int (*spare_active) (mddev_t *mddev, mdp_disk_t **descriptor); + int (*spare_active) (mddev_t *mddev); int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); }; @@ -228,38 +248,30 @@ static inline kdev_t mddev_to_kdev(mddev_t * mddev) return mk_kdev(MD_MAJOR, mdidx(mddev)); } -extern mdk_rdev_t * find_rdev(mddev_t * mddev, kdev_t dev); extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr); -extern mdp_disk_t *get_spare(mddev_t *mddev); +extern mdk_rdev_t *get_spare(mddev_t *mddev); /* * iterates through some rdev ringlist. It's safe to remove the * current 'rdev'. Dont touch 'tmp' though. */ -#define ITERATE_RDEV_GENERIC(head,field,rdev,tmp) \ +#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ \ for ((tmp) = (head).next; \ - (rdev) = (list_entry((tmp), mdk_rdev_t, field)), \ + (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ (tmp) = (tmp)->next, (tmp)->prev != &(head) \ ; ) /* * iterates through the 'same array disks' ringlist */ #define ITERATE_RDEV(mddev,rdev,tmp) \ - ITERATE_RDEV_GENERIC((mddev)->disks,same_set,rdev,tmp) - - -/* - * Iterates through all 'RAID managed disks' - */ -#define ITERATE_RDEV_ALL(rdev,tmp) \ - ITERATE_RDEV_GENERIC(all_raid_disks,all,rdev,tmp) + ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) /* * Iterates through 'pending RAID disks' */ #define ITERATE_RDEV_PENDING(rdev,tmp) \ - ITERATE_RDEV_GENERIC(pending_raid_disks,pending,rdev,tmp) + ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) #define xchg_values(x,y) do { __typeof__(x) __tmp = x; \ x = y; y = __tmp; } while (0) diff --git a/include/linux/raid/multipath.h b/include/linux/raid/multipath.h index e4f3e6189b7b..6ceb343eedb0 100644 --- a/include/linux/raid/multipath.h +++ b/include/linux/raid/multipath.h @@ -2,17 +2,15 @@ #define _MULTIPATH_H #include <linux/raid/md.h> +#include <linux/bio.h> struct multipath_info { - int number; - int raid_disk; struct block_device *bdev; /* * State bits: */ int operational; - int spare; int used_slot; }; @@ -20,23 +18,12 @@ struct multipath_info { struct multipath_private_data { mddev_t *mddev; struct multipath_info multipaths[MD_SB_DISKS]; - int nr_disks; int raid_disks; int working_disks; mdk_thread_t *thread; - struct multipath_info *spare; spinlock_t device_lock; - /* buffer pool */ - /* buffer_heads that we have pre-allocated have b_pprev -> &freebh - * and are linked into a stack using b_next - * multipath_bh that are pre-allocated have MPBH_PreAlloc set. - * All these variable are protected by device_lock - */ - struct multipath_bh *freer1; - int freer1_blocked; - int freer1_cnt; - wait_queue_head_t wait_buffer; + mempool_t *pool; }; typedef struct multipath_private_data multipath_conf_t; @@ -54,18 +41,10 @@ typedef struct multipath_private_data multipath_conf_t; */ struct multipath_bh { - atomic_t remaining; /* 'have we finished' count, - * used from IRQ handlers - */ - int cmd; - unsigned long state; mddev_t *mddev; struct bio *master_bio; - struct bio *bio; - struct multipath_bh *next_mp; /* next for retry or in free list */ + struct bio bio; + int path; + struct multipath_bh *next_mp; /* next for retry */ }; -/* bits for multipath_bh.state */ -#define MPBH_Uptodate 1 -#define MPBH_SyncPhase 2 -#define MPBH_PreAlloc 3 /* this was pre-allocated, add to free list */ #endif diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index f63d68e55c11..28651c4d0658 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -6,8 +6,6 @@ typedef struct mirror_info mirror_info_t; struct mirror_info { - int number; - int raid_disk; struct block_device *bdev; sector_t head_position; atomic_t nr_pending; @@ -27,7 +25,6 @@ typedef struct r1bio_s r1bio_t; struct r1_private_data_s { mddev_t *mddev; mirror_info_t mirrors[MD_SB_DISKS]; - int nr_disks; int raid_disks; int working_disks; int last_used; diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 7f8beb8acdaa..7e8333a75bd4 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -194,8 +194,6 @@ struct stripe_head { struct disk_info { struct block_device *bdev; int operational; - int number; - int raid_disk; int write_only; int spare; int used_slot; diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 0a247f460ff7..eca42599039f 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -37,7 +37,7 @@ #define RPC_MAXREQS RPC_MAXCONG #define RPC_CWNDSCALE (256) #define RPC_MAXCWND (RPC_MAXCONG * RPC_CWNDSCALE) -#define RPC_INITCWND (RPC_MAXCWND >> 1) +#define RPC_INITCWND RPC_CWNDSCALE #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd) /* Default timeout values */ |
