Remove the _t typedef and remove the _s suffix from the struct name.
These things do not help readability.
Signed-off-by: NeilBrown <neilb@suse.de>
return busy;
}
-static int ident_matches(struct mddev_ident_s *ident,
+static int ident_matches(struct mddev_ident *ident,
struct mdinfo *content,
struct supertype *tst,
char *homehost,
int Assemble(struct supertype *st, char *mddev,
- mddev_ident_t ident,
+ struct mddev_ident *ident,
mddev_dev_t devlist, char *backup_file,
int readonly, int runstop,
char *update, char *homehost, int require_homehost,
char *homehost,
int verbose, int runstop, int autof);
-static struct mddev_ident_s *search_mdstat(struct supertype *st,
+static struct mddev_ident *search_mdstat(struct supertype *st,
struct mdinfo *info,
char *devname,
int verbose, int *rvp);
*/
struct stat stb;
struct mdinfo info, dinfo;
- struct mddev_ident_s *match;
+ struct mddev_ident *match;
char chosen_name[1024];
int rv = 1;
struct map_ent *mp, *map = NULL;
return rv;
}
-static struct mddev_ident_s *search_mdstat(struct supertype *st,
+static struct mddev_ident *search_mdstat(struct supertype *st,
struct mdinfo *info,
char *devname,
int verbose, int *rvp)
{
- struct mddev_ident_s *array_list, *match;
+ struct mddev_ident *array_list, *match;
array_list = conf_get_ident(NULL);
match = NULL;
for (; array_list; array_list = array_list->next) {
*/
struct map_ent *mapl = NULL;
struct map_ent *me;
- mddev_ident_t devs, mddev;
+ struct mddev_ident *devs, *mddev;
int rv = 0;
map_read(&mapl);
struct map_ent *map = NULL;
struct mdinfo info;
int trustworthy;
- struct mddev_ident_s *match;
+ struct mddev_ident *match;
int rv = 0;
memset(&info, 0, sizeof(info));
int mdfd;
char chosen_name[1024];
struct map_ent *mp;
- struct mddev_ident_s *match = NULL;
+ struct mddev_ident *match = NULL;
mp = map_by_uuid(&map, ra->uuid);
* member == ra->text_version after second slash.
*/
char *sub = strchr(ra->text_version+1, '/');
- struct mddev_ident_s *array_list;
+ struct mddev_ident *array_list;
if (sub) {
sub++;
array_list = conf_get_ident(NULL);
return rv;
}
-int Update_subarray(char *dev, char *subarray, char *update, mddev_ident_t ident, int quiet)
+int Update_subarray(char *dev, char *subarray, char *update, struct mddev_ident *ident, int quiet)
{
struct supertype supertype, *st = &supertype;
int fd, rv = 2;
}
if (devlist == NULL) {
- mddev_ident_t mdlist = conf_get_ident(NULL);
+ struct mddev_ident *mdlist = conf_get_ident(NULL);
for (; mdlist; mdlist=mdlist->next) {
struct state *st;
if (mdlist->devname == NULL)
} else {
mddev_dev_t dv;
for (dv=devlist ; dv; dv=dv->next) {
- mddev_ident_t mdlist = conf_get_ident(dv->devname);
+ struct mddev_ident *mdlist = conf_get_ident(dv->devname);
struct state *st = malloc(sizeof *st);
if (st == NULL)
continue;
}
}
-mddev_ident_t mddevlist = NULL;
-mddev_ident_t *mddevlp = &mddevlist;
+struct mddev_ident *mddevlist = NULL;
+struct mddev_ident **mddevlp = &mddevlist;
static int is_number(char *w)
{
{
char *w;
- struct mddev_ident_s mis;
- mddev_ident_t mi;
+ struct mddev_ident mis;
+ struct mddev_ident *mi;
mis.uuid_set = 0;
mis.super_minor = UnSet;
return &createinfo;
}
-mddev_ident_t conf_get_ident(char *dev)
+struct mddev_ident *conf_get_ident(char *dev)
{
- mddev_ident_t rv;
+ struct mddev_ident *rv;
load_conffile();
rv = mddevlist;
while (dev && rv && (rv->devname == NULL
* It can be taken either by a match on devname, name, or
* even super-minor.
*/
- mddev_ident_t dev;
+ struct mddev_ident *dev;
load_conffile();
for (dev = mddevlist; dev; dev = dev->next) {
return 1;
}
-struct mddev_ident_s *conf_match(struct mdinfo *info, struct supertype *st)
+struct mddev_ident *conf_match(struct mdinfo *info, struct supertype *st)
{
- struct mddev_ident_s *array_list, *match;
+ struct mddev_ident *array_list, *match;
int verbose = 0;
char *devname = NULL;
array_list = conf_get_ident(NULL);
* find a unique name based on metadata name.
*
*/
- struct mddev_ident_s *match = conf_match(info, st);
+ struct mddev_ident *match = conf_match(info, st);
struct stat stb;
if (match && match->devname && match->devname[0] == '/') {
path = match->devname;
int raiddisks = 0;
int max_disks = MD_SB_DISKS; /* just a default */
int sparedisks = 0;
- struct mddev_ident_s ident;
+ struct mddev_ident ident;
char *configfile = NULL;
char *cp;
char *update = NULL;
if (devs_found == 1 && ident.uuid_set == 0 &&
ident.super_minor == UnSet && ident.name[0] == 0 && !scan ) {
/* Only a device has been given, so get details from config file */
- mddev_ident_t array_ident = conf_get_ident(devlist->devname);
+ struct mddev_ident *array_ident = conf_get_ident(devlist->devname);
if (array_ident == NULL) {
fprintf(stderr, Name ": %s not identified in config file.\n",
devlist->devname);
exit(1);
}
for (dv = devlist ; dv ; dv=dv->next) {
- mddev_ident_t array_ident = conf_get_ident(dv->devname);
+ struct mddev_ident *array_ident = conf_get_ident(dv->devname);
if (array_ident == NULL) {
fprintf(stderr, Name ": %s not identified in config file.\n",
dv->devname);
verbose-quiet, force);
}
} else {
- mddev_ident_t a, array_list = conf_get_ident(NULL);
+ struct mddev_ident *a, *array_list = conf_get_ident(NULL);
mddev_dev_t devlist = conf_get_devs();
int cnt = 0;
int failures, successes;
* devices is considered
*/
#define UnSet (0xfffe)
-typedef struct mddev_ident_s {
+struct mddev_ident {
char *devname;
int uuid_set;
*/
char *member; /* subarray within a container */
- struct mddev_ident_s *next;
+ struct mddev_ident *next;
union {
/* fields needed by different users of this structure */
int assembled; /* set when assembly succeeds */
};
-} *mddev_ident_t;
+};
/* List of device names - wildcards expanded */
typedef struct mddev_dev_s {
int (*kill_subarray)(struct supertype *st); /* optional */
/* Permit subarray's to be modified */
int (*update_subarray)(struct supertype *st, char *subarray,
- char *update, mddev_ident_t ident); /* optional */
+ char *update, struct mddev_ident *ident); /* optional */
/* for mdmon */
int (*open_new)(struct supertype *c, struct active_array *a,
struct mdinfo *info, char *backup_file);
extern int Assemble(struct supertype *st, char *mddev,
- mddev_ident_t ident,
+ struct mddev_ident *ident,
mddev_dev_t devlist, char *backup_file,
int readonly, int runstop,
char *update, char *homehost, int require_homehost,
extern int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl);
extern int Kill_subarray(char *dev, char *subarray, int quiet);
-extern int Update_subarray(char *dev, char *subarray, char *update, mddev_ident_t ident, int quiet);
+extern int Update_subarray(char *dev, char *subarray, char *update, struct mddev_ident *ident, int quiet);
extern int Wait(char *dev);
extern int WaitClean(char *dev, int sock, int verbose);
extern int same_dev(char *one, char *two);
extern int parse_auto(char *str, char *msg, int config);
-extern mddev_ident_t conf_get_ident(char *dev);
+extern struct mddev_ident *conf_get_ident(char *dev);
extern mddev_dev_t conf_get_devs(void);
extern int conf_test_dev(char *devname);
extern int conf_test_metadata(const char *version, struct dev_policy *pol, int is_homehost);
extern char *conf_word(FILE *file, int allow_key);
extern int conf_name_is_free(char *name);
extern int devname_matches(char *name, char *match);
-extern struct mddev_ident_s *conf_match(struct mdinfo *info, struct supertype *st);
+extern struct mddev_ident *conf_match(struct mdinfo *info, struct supertype *st);
extern void free_line(char *line);
extern int match_oneof(char *devices, char *devname);
int force = 0;
int main(int argc, char *argv[]) {
- mddev_ident_t array_list = conf_get_ident(NULL);
+ struct mddev_ident *array_list = conf_get_ident(NULL);
if (!array_list) {
fprintf(stderr, Name ": No arrays found in config file\n");
rv = 1;
/* check the config file to see if we can return a real uuid for this spare */
static void fixup_container_spare_uuid(struct mdinfo *inf)
{
- struct mddev_ident_s *array_list;
+ struct mddev_ident *array_list;
if (inf->array.level != LEVEL_CONTAINER ||
memcmp(inf->uuid, uuid_match_any, sizeof(int[4])) != 0)
}
static int update_subarray_imsm(struct supertype *st, char *subarray,
- char *update, mddev_ident_t ident)
+ char *update, struct mddev_ident *ident)
{
/* update the subarray currently referenced by ->current_vol */
struct intel_super *super = st->sb;