aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index a49d991f3fe1..03cec5bdcaae 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -1,15 +1,15 @@
1/* 1/*
2 md.h : kernel internal structure of the Linux MD driver 2 md.h : kernel internal structure of the Linux MD driver
3 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman 3 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option) 7 the Free Software Foundation; either version 2, or (at your option)
8 any later version. 8 any later version.
9 9
10 You should have received a copy of the GNU General Public License 10 You should have received a copy of the GNU General Public License
11 (for example /usr/src/linux/COPYING); if not, write to the Free 11 (for example /usr/src/linux/COPYING); if not, write to the Free
12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13*/ 13*/
14 14
15#ifndef _MD_MD_H 15#ifndef _MD_MD_H
@@ -56,7 +56,7 @@ struct md_rdev {
56 __u64 sb_events; 56 __u64 sb_events;
57 sector_t data_offset; /* start of data in array */ 57 sector_t data_offset; /* start of data in array */
58 sector_t new_data_offset;/* only relevant while reshaping */ 58 sector_t new_data_offset;/* only relevant while reshaping */
59 sector_t sb_start; /* offset of the super block (in 512byte sectors) */ 59 sector_t sb_start; /* offset of the super block (in 512byte sectors) */
60 int sb_size; /* bytes in the superblock */ 60 int sb_size; /* bytes in the superblock */
61 int preferred_minor; /* autorun support */ 61 int preferred_minor; /* autorun support */
62 62
@@ -239,7 +239,7 @@ struct mddev {
239 minor_version, 239 minor_version,
240 patch_version; 240 patch_version;
241 int persistent; 241 int persistent;
242 int external; /* metadata is 242 int external; /* metadata is
243 * managed externally */ 243 * managed externally */
244 char metadata_type[17]; /* externally set*/ 244 char metadata_type[17]; /* externally set*/
245 int chunk_sectors; 245 int chunk_sectors;
@@ -248,7 +248,7 @@ struct mddev {
248 char clevel[16]; 248 char clevel[16];
249 int raid_disks; 249 int raid_disks;
250 int max_disks; 250 int max_disks;
251 sector_t dev_sectors; /* used size of 251 sector_t dev_sectors; /* used size of
252 * component devices */ 252 * component devices */
253 sector_t array_sectors; /* exported array size */ 253 sector_t array_sectors; /* exported array size */
254 int external_size; /* size managed 254 int external_size; /* size managed
@@ -312,7 +312,7 @@ struct mddev {
312 int parallel_resync; 312 int parallel_resync;
313 313
314 int ok_start_degraded; 314 int ok_start_degraded;
315 /* recovery/resync flags 315 /* recovery/resync flags
316 * NEEDED: we might need to start a resync/recover 316 * NEEDED: we might need to start a resync/recover
317 * RUNNING: a thread is running, or about to be started 317 * RUNNING: a thread is running, or about to be started
318 * SYNC: actually doing a resync, not a recovery 318 * SYNC: actually doing a resync, not a recovery
@@ -392,20 +392,20 @@ struct mddev {
392 392
393 unsigned int safemode; /* if set, update "clean" superblock 393 unsigned int safemode; /* if set, update "clean" superblock
394 * when no writes pending. 394 * when no writes pending.
395 */ 395 */
396 unsigned int safemode_delay; 396 unsigned int safemode_delay;
397 struct timer_list safemode_timer; 397 struct timer_list safemode_timer;
398 atomic_t writes_pending; 398 atomic_t writes_pending;
399 struct request_queue *queue; /* for plugging ... */ 399 struct request_queue *queue; /* for plugging ... */
400 400
401 struct bitmap *bitmap; /* the bitmap for the device */ 401 struct bitmap *bitmap; /* the bitmap for the device */
402 struct { 402 struct {
403 struct file *file; /* the bitmap file */ 403 struct file *file; /* the bitmap file */
404 loff_t offset; /* offset from superblock of 404 loff_t offset; /* offset from superblock of
405 * start of bitmap. May be 405 * start of bitmap. May be
406 * negative, but not '0' 406 * negative, but not '0'
407 * For external metadata, offset 407 * For external metadata, offset
408 * from start of device. 408 * from start of device.
409 */ 409 */
410 unsigned long space; /* space available at this offset */ 410 unsigned long space; /* space available at this offset */
411 loff_t default_offset; /* this is the offset to use when 411 loff_t default_offset; /* this is the offset to use when
@@ -421,7 +421,7 @@ struct mddev {
421 int external; 421 int external;
422 } bitmap_info; 422 } bitmap_info;
423 423
424 atomic_t max_corr_read_errors; /* max read retries */ 424 atomic_t max_corr_read_errors; /* max read retries */
425 struct list_head all_mddevs; 425 struct list_head all_mddevs;
426 426
427 struct attribute_group *to_remove; 427 struct attribute_group *to_remove;
@@ -439,7 +439,6 @@ struct mddev {
439 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev); 439 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
440}; 440};
441 441
442
443static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) 442static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev)
444{ 443{
445 int faulty = test_bit(Faulty, &rdev->flags); 444 int faulty = test_bit(Faulty, &rdev->flags);
@@ -449,7 +448,7 @@ static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev)
449 448
450static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) 449static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
451{ 450{
452 atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io); 451 atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io);
453} 452}
454 453
455struct md_personality 454struct md_personality
@@ -463,7 +462,7 @@ struct md_personality
463 int (*stop)(struct mddev *mddev); 462 int (*stop)(struct mddev *mddev);
464 void (*status)(struct seq_file *seq, struct mddev *mddev); 463 void (*status)(struct seq_file *seq, struct mddev *mddev);
465 /* error_handler must set ->faulty and clear ->in_sync 464 /* error_handler must set ->faulty and clear ->in_sync
466 * if appropriate, and should abort recovery if needed 465 * if appropriate, and should abort recovery if needed
467 */ 466 */
468 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev); 467 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
469 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev); 468 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
@@ -493,7 +492,6 @@ struct md_personality
493 void *(*takeover) (struct mddev *mddev); 492 void *(*takeover) (struct mddev *mddev);
494}; 493};
495 494
496
497struct md_sysfs_entry { 495struct md_sysfs_entry {
498 struct attribute attr; 496 struct attribute attr;
499 ssize_t (*show)(struct mddev *, char *); 497 ssize_t (*show)(struct mddev *, char *);
@@ -560,7 +558,7 @@ struct md_thread {
560 void (*run) (struct md_thread *thread); 558 void (*run) (struct md_thread *thread);
561 struct mddev *mddev; 559 struct mddev *mddev;
562 wait_queue_head_t wqueue; 560 wait_queue_head_t wqueue;
563 unsigned long flags; 561 unsigned long flags;
564 struct task_struct *tsk; 562 struct task_struct *tsk;
565 unsigned long timeout; 563 unsigned long timeout;
566 void *private; 564 void *private;
@@ -594,7 +592,7 @@ extern void md_flush_request(struct mddev *mddev, struct bio *bio);
594extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev, 592extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
595 sector_t sector, int size, struct page *page); 593 sector_t sector, int size, struct page *page);
596extern void md_super_wait(struct mddev *mddev); 594extern void md_super_wait(struct mddev *mddev);
597extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, 595extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
598 struct page *page, int rw, bool metadata_op); 596 struct page *page, int rw, bool metadata_op);
599extern void md_do_sync(struct md_thread *thread); 597extern void md_do_sync(struct md_thread *thread);
600extern void md_new_event(struct mddev *mddev); 598extern void md_new_event(struct mddev *mddev);