aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:39:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:39:52 -0400
commit88ed806abb981cc8ec61ee7fab93ecfe63521ebf (patch)
treef3639f4a6862598fcdbb444ef4b5bbceb63d5c46 /drivers/md/md.h
parente56d9fccb1c78283d7c163bb354be7cbbc93d9fb (diff)
parentb395f75eabb3844c99244928293796ff42feaa3d (diff)
Merge tag 'md/3.18' of git://neil.brown.name/md
Pull md updates from Neil Brown: - a few minor bug fixes - quite a lot of code tidy-up and simplification - remove PRINT_RAID_DEBUG ioctl. I'm fairly sure it is unused, and it isn't particularly useful. * tag 'md/3.18' of git://neil.brown.name/md: (21 commits) lib/raid6: Add log level to printks md: move EXPORT_SYMBOL to after function in md.c md: discard PRINT_RAID_DEBUG ioctl md: remove MD_BUG() md: clean up 'exit' labels in md_ioctl(). md: remove unnecessary test for MD_MAJOR in md_ioctl() md: don't allow "-sync" to be set for device in an active array. md: remove unwanted white space from md.c md: don't start resync thread directly from md thread. md: Just use RCU when checking for overlap between arrays. md: avoid potential long delay under pers_lock md: simplify export_array() md: discard find_rdev_nr in favour of find_rdev_nr_rcu md: use wait_event() to simplify md_super_wait() md: be more relaxed about stopping an array which isn't started. md/raid1: process_checks doesn't use its return value. md/raid5: fix init_stripe() inconsistencies md/raid10: another memory leak due to reshape. md: use set_bit/clear_bit instead of shift/mask for bi_flags changes. md/raid1: minor typos and reformatting. ...
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);