diff options
author | Neil Brown <neilb@suse.de> | 2008-05-15 16:48:12 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-05-15 16:48:12 +1000 |
commit | 111d01fcc76d2e7d0b05f78fae67e89cdf6856ad (patch) | |
tree | 2faa362b6581db04a41f876a57c4b1c9ca6582a7 /mdadm.h | |
parent | 11fcec12ef68fa3b915e26676c47ee0f97d62256 (diff) | |
download | mdadm-111d01fcc76d2e7d0b05f78fae67e89cdf6856ad.tar.gz mdadm-111d01fcc76d2e7d0b05f78fae67e89cdf6856ad.tar.xz mdadm-111d01fcc76d2e7d0b05f78fae67e89cdf6856ad.zip |
Change write_init_super to be called only once.
The current model for creating arrays involves writing
a superblock to each device in the array.
With containers (as with DDF), that model doesn't work.
Every device in the container may need to be updated
for an array made from just some the devices in a container.
So instead of calling write_init_super for each device,
we call it once for the array and have it iterate over
all the devices in the array.
To help with this, ->add_to_super now passes in an 'fd' and name for
the device. These get saved for use by write_init_super. So
add_to_super takes ownership of the fd, and write_init_super will
close it.
This information is stored in the new 'info' field of supertype.
As part of this, write_init_super now removes any old traces of raid
metadata rather than doing this in common code.
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -358,10 +358,10 @@ extern struct superswitch { int (*init_super)(struct supertype *st, mdu_array_info_t *info, unsigned long long size, char *name, char *homehost, int *uuid); - void (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo); + void (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo, + int fd, char *devname); int (*store_super)(struct supertype *st, int fd); - int (*write_init_super)(struct supertype *st, mdu_disk_info_t *dinfo, - char *devname); + int (*write_init_super)(struct supertype *st); int (*compare_super)(struct supertype *st, struct supertype *tst); int (*load_super)(struct supertype *st, int fd, char *devname); struct supertype * (*match_metadata_desc)(char *arg); @@ -385,6 +385,7 @@ struct supertype { int minor_version; int max_devs; void *sb; + void *info; }; extern struct supertype *super_by_fd(int fd); @@ -477,7 +478,7 @@ extern int Monitor(mddev_dev_t devlist, int period, int daemonise, int scan, int oneshot, int dosyslog, int test, char *pidfile); -extern int Kill(char *dev, int force, int quiet); +extern int Kill(char *dev, int force, int quiet, int noexcl); extern int Wait(char *dev); extern int Incremental(char *devname, int verbose, int runstop, |