#include <linux/blkdev.h>
#include <linux/kobject.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
Go to the source code of this file.
|
#define | MaxSector (~(sector_t)0) |
|
#define | MD_MAX_BADBLOCKS (PAGE_SIZE/8) |
|
#define | BB_LEN_MASK (0x00000000000001FFULL) |
|
#define | BB_OFFSET_MASK (0x7FFFFFFFFFFFFE00ULL) |
|
#define | BB_ACK_MASK (0x8000000000000000ULL) |
|
#define | BB_MAX_LEN 512 |
|
#define | BB_OFFSET(x) (((x) & BB_OFFSET_MASK) >> 9) |
|
#define | BB_LEN(x) (((x) & BB_LEN_MASK) + 1) |
|
#define | BB_ACK(x) (!!((x) & BB_ACK_MASK)) |
|
#define | BB_MAKE(a, l, ack) (((a)<<9) | ((l)-1) | ((u64)(!!(ack)) << 63)) |
|
#define | MD_CHANGE_DEVS 0 /* Some device status has changed */ |
|
#define | MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
|
#define | MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */ |
|
#define | MD_ARRAY_FIRST_USE 3 /* First use of array, needs initialization */ |
|
#define | UNTIL_IOCTL 1 |
|
#define | UNTIL_STOP 2 |
|
#define | MD_RECOVERY_RUNNING 0 |
|
#define | MD_RECOVERY_SYNC 1 |
|
#define | MD_RECOVERY_RECOVER 2 |
|
#define | MD_RECOVERY_INTR 3 |
|
#define | MD_RECOVERY_DONE 4 |
|
#define | MD_RECOVERY_NEEDED 5 |
|
#define | MD_RECOVERY_REQUESTED 6 |
|
#define | MD_RECOVERY_CHECK 7 |
|
#define | MD_RECOVERY_RESHAPE 8 |
|
#define | MD_RECOVERY_FROZEN 9 |
|
#define | rdev_for_each_list(rdev, tmp, head) list_for_each_entry_safe(rdev, tmp, head, same_set) |
|
#define | rdev_for_each(rdev, mddev) list_for_each_entry(rdev, &((mddev)->disks), same_set) |
|
#define | rdev_for_each_safe(rdev, tmp, mddev) list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set) |
|
#define | rdev_for_each_rcu(rdev, mddev) list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) |
|
#define | THREAD_WAKEUP 0 |
|
#define | __wait_event_lock_irq(wq, condition, lock, cmd) |
|
#define | wait_event_lock_irq(wq, condition, lock, cmd) |
|
|
enum | flag_bits {
Faulty,
In_sync,
Unmerged,
WriteMostly,
AutoDetected,
Blocked,
WriteErrorSeen,
FaultRecorded,
BlockedBadBlocks,
WantReplacement,
Replacement
} |
|
|
int | md_is_badblock (struct badblocks *bb, sector_t s, int sectors, sector_t *first_bad, int *bad_sectors) |
|
int | rdev_set_badblocks (struct md_rdev *rdev, sector_t s, int sectors, int is_new) |
|
int | rdev_clear_badblocks (struct md_rdev *rdev, sector_t s, int sectors, int is_new) |
|
void | md_ack_all_badblocks (struct badblocks *bb) |
|
int | register_md_personality (struct md_personality *p) |
|
int | unregister_md_personality (struct md_personality *p) |
|
struct md_thread * | md_register_thread (void(*run)(struct md_thread *thread), struct mddev *mddev, const char *name) |
|
void | md_unregister_thread (struct md_thread **threadp) |
|
void | md_wakeup_thread (struct md_thread *thread) |
|
void | md_check_recovery (struct mddev *mddev) |
|
void | md_write_start (struct mddev *mddev, struct bio *bi) |
|
void | md_write_end (struct mddev *mddev) |
|
void | md_done_sync (struct mddev *mddev, int blocks, int ok) |
|
void | md_error (struct mddev *mddev, struct md_rdev *rdev) |
|
void | md_finish_reshape (struct mddev *mddev) |
|
int | mddev_congested (struct mddev *mddev, int bits) |
|
void | md_flush_request (struct mddev *mddev, struct bio *bio) |
|
void | md_super_write (struct mddev *mddev, struct md_rdev *rdev, sector_t sector, int size, struct page *page) |
|
void | md_super_wait (struct mddev *mddev) |
|
int | sync_page_io (struct md_rdev *rdev, sector_t sector, int size, struct page *page, int rw, bool metadata_op) |
|
void | md_do_sync (struct md_thread *thread) |
|
void | md_new_event (struct mddev *mddev) |
|
int | md_allow_write (struct mddev *mddev) |
|
void | md_wait_for_blocked_rdev (struct md_rdev *rdev, struct mddev *mddev) |
|
void | md_set_array_sectors (struct mddev *mddev, sector_t array_sectors) |
|
int | md_check_no_bitmap (struct mddev *mddev) |
|
int | md_integrity_register (struct mddev *mddev) |
|
void | md_integrity_add_rdev (struct md_rdev *rdev, struct mddev *mddev) |
|
int | strict_strtoul_scaled (const char *cp, unsigned long *res, int scale) |
|
void | restore_bitmap_write_access (struct file *file) |
|
void | mddev_init (struct mddev *mddev) |
|
int | md_run (struct mddev *mddev) |
|
void | md_stop (struct mddev *mddev) |
|
void | md_stop_writes (struct mddev *mddev) |
|
int | md_rdev_init (struct md_rdev *rdev) |
|
void | md_rdev_clear (struct md_rdev *rdev) |
|
void | mddev_suspend (struct mddev *mddev) |
|
void | mddev_resume (struct mddev *mddev) |
|
struct bio * | bio_clone_mddev (struct bio *bio, gfp_t gfp_mask, struct mddev *mddev) |
|
struct bio * | bio_alloc_mddev (gfp_t gfp_mask, int nr_iovecs, struct mddev *mddev) |
|
void | md_trim_bio (struct bio *bio, int offset, int size) |
|
void | md_unplug (struct blk_plug_cb *cb, bool from_schedule) |
|
#define __wait_event_lock_irq |
( |
|
wq, |
|
|
|
condition, |
|
|
|
lock, |
|
|
|
cmd |
|
) |
| |
Value:
init_waitqueue_entry(&__wait,
current);
\
for (;;) { \
if (condition) \
break; \
spin_unlock_irq(&lock);
\
schedule(); \
spin_lock_irq(&lock); \
} \
remove_wait_queue(&wq, &__wait); \
} while (0)
Definition at line 554 of file md.h.
Definition at line 178 of file md.h.
#define BB_ACK_MASK (0x8000000000000000ULL) |
Definition at line 174 of file md.h.
Definition at line 177 of file md.h.
#define BB_LEN_MASK (0x00000000000001FFULL) |
Definition at line 172 of file md.h.
#define BB_MAKE |
( |
|
a, |
|
|
|
l, |
|
|
|
ack |
|
) |
| (((a)<<9) | ((l)-1) | ((u64)(!!(ack)) << 63)) |
Definition at line 179 of file md.h.
Definition at line 175 of file md.h.
Definition at line 176 of file md.h.
#define BB_OFFSET_MASK (0x7FFFFFFFFFFFFE00ULL) |
Definition at line 173 of file md.h.
Definition at line 27 of file md.h.
#define MD_ARRAY_FIRST_USE 3 /* First use of array, needs initialization */ |
Definition at line 212 of file md.h.
#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
Definition at line 210 of file md.h.
Definition at line 209 of file md.h.
Definition at line 211 of file md.h.
Definition at line 34 of file md.h.
#define MD_RECOVERY_CHECK 7 |
Definition at line 320 of file md.h.
#define MD_RECOVERY_DONE 4 |
Definition at line 317 of file md.h.
#define MD_RECOVERY_FROZEN 9 |
Definition at line 322 of file md.h.
#define MD_RECOVERY_INTR 3 |
Definition at line 316 of file md.h.
#define MD_RECOVERY_NEEDED 5 |
Definition at line 318 of file md.h.
#define MD_RECOVERY_RECOVER 2 |
Definition at line 315 of file md.h.
#define MD_RECOVERY_REQUESTED 6 |
Definition at line 319 of file md.h.
#define MD_RECOVERY_RESHAPE 8 |
Definition at line 321 of file md.h.
#define MD_RECOVERY_RUNNING 0 |
Definition at line 313 of file md.h.
#define MD_RECOVERY_SYNC 1 |
Definition at line 314 of file md.h.
Definition at line 533 of file md.h.
Definition at line 527 of file md.h.
#define rdev_for_each_rcu |
( |
|
rdev, |
|
|
|
mddev |
|
) |
| list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) |
Definition at line 539 of file md.h.
Definition at line 536 of file md.h.
Definition at line 552 of file md.h.
Definition at line 227 of file md.h.
Definition at line 228 of file md.h.
#define wait_event_lock_irq |
( |
|
wq, |
|
|
|
condition, |
|
|
|
lock, |
|
|
|
cmd |
|
) |
| |
Value:do { \
if (condition) \
break; \
__wait_event_lock_irq(wq, condition, lock,
cmd); \
} while (0)
Definition at line 573 of file md.h.
- Enumerator:
Faulty |
|
In_sync |
|
Unmerged |
|
WriteMostly |
|
AutoDetected |
|
Blocked |
|
WriteErrorSeen |
|
FaultRecorded |
|
BlockedBadBlocks |
|
WantReplacement |
|
Replacement |
|
Definition at line 129 of file md.h.
Definition at line 158 of file md.c.
Definition at line 173 of file md.c.
void md_ack_all_badblocks |
( |
struct badblocks * |
bb | ) |
|
Definition at line 450 of file md.c.
Definition at line 244 of file md.c.
Definition at line 743 of file md.c.
Definition at line 799 of file md.c.
Definition at line 778 of file md.c.
Definition at line 183 of file md.c.
Definition at line 464 of file md.c.
Definition at line 374 of file md.c.
Definition at line 509 of file md.c.
Definition at line 362 of file md.c.
Definition at line 350 of file md.c.
Definition at line 817 of file md.c.