* [PATCH] Monitor: pass statelist reference when adding new arrays
@ 2010-12-01 10:37 Czarnowska, Anna
2010-12-01 11:25 ` Neil Brown
0 siblings, 1 reply; 2+ messages in thread
From: Czarnowska, Anna @ 2010-12-01 10:37 UTC (permalink / raw)
To: Neil Brown
Cc: linux-raid@vger.kernel.org, Neubauer, Wojciech, Williams, Dan J,
Ciechanowski, Ed, Labun, Marcin,
Hawrylewicz Czarnowski, Przemyslaw
From af217d38a81223408fc53ef485d7c5bd43b9d841 Mon Sep 17 00:00:00 2001
From: Anna Czarnowska <anna.czarnowska@intel.com>
Date: Tue, 30 Nov 2010 14:44:45 +0100
Subject: [PATCH] Monitor: pass statelist reference when adding new arrays
Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
Otherwise it will not get updated.
Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
---
Monitor.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Monitor.c b/Monitor.c
index d5514e9..e7f6d03 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -70,7 +70,7 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info);
static int check_array(struct state *st, struct mdstat_ent *mdstat,
int test, struct alert_info *info,
int increments);
-static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
+static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
int test, struct alert_info *info);
static void try_spare_migration(struct state *statelist, struct alert_info *info);
static void link_containers_with_subarrays(struct state *list);
@@ -223,7 +223,7 @@ int Monitor(struct mddev_dev *devlist,
/* now check if there are any new devices found in mdstat */
if (scan)
- new_found = add_new_arrays(mdstat, statelist, test,
+ new_found = add_new_arrays(mdstat, &statelist, test,
&info);
/* If an array has active < raid && spare == 0 && spare_group != NULL
@@ -642,7 +642,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
return 0;
}
-static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
+static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
int test, struct alert_info *info)
{
struct mdstat_ent *mse;
@@ -674,7 +674,7 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
continue;
}
close(fd);
- st->next = statelist;
+ st->next = *statelist;
st->err = 1;
st->devnum = mse->devnum;
st->percent = -2;
@@ -685,7 +685,7 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
devname2devnum(mse->metadata_version+10);
else
st->parent_dev = NoMdDev;
- statelist = st;
+ *statelist = st;
if (test)
alert("TestMessage", st->devname, NULL, info);
alert("NewArray", st->devname, NULL, info);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Monitor: pass statelist reference when adding new arrays
2010-12-01 10:37 [PATCH] Monitor: pass statelist reference when adding new arrays Czarnowska, Anna
@ 2010-12-01 11:25 ` Neil Brown
0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2010-12-01 11:25 UTC (permalink / raw)
To: Czarnowska, Anna
Cc: linux-raid@vger.kernel.org, Neubauer, Wojciech, Williams, Dan J,
Ciechanowski, Ed, Labun, Marcin,
Hawrylewicz Czarnowski, Przemyslaw
On Wed, 1 Dec 2010 10:37:22 +0000 "Czarnowska, Anna"
<anna.czarnowska@intel.com> wrote:
> >From af217d38a81223408fc53ef485d7c5bd43b9d841 Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska <anna.czarnowska@intel.com>
> Date: Tue, 30 Nov 2010 14:44:45 +0100
> Subject: [PATCH] Monitor: pass statelist reference when adding new arrays
> Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
>
> Otherwise it will not get updated.
Yes, of course.
Thanks a lot!
Applied and pushed out.
NeilBrown
>
> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
> ---
> Monitor.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Monitor.c b/Monitor.c
> index d5514e9..e7f6d03 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -70,7 +70,7 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info);
> static int check_array(struct state *st, struct mdstat_ent *mdstat,
> int test, struct alert_info *info,
> int increments);
> -static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
> +static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
> int test, struct alert_info *info);
> static void try_spare_migration(struct state *statelist, struct alert_info *info);
> static void link_containers_with_subarrays(struct state *list);
> @@ -223,7 +223,7 @@ int Monitor(struct mddev_dev *devlist,
>
> /* now check if there are any new devices found in mdstat */
> if (scan)
> - new_found = add_new_arrays(mdstat, statelist, test,
> + new_found = add_new_arrays(mdstat, &statelist, test,
> &info);
>
> /* If an array has active < raid && spare == 0 && spare_group != NULL
> @@ -642,7 +642,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
> return 0;
> }
>
> -static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
> +static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
> int test, struct alert_info *info)
> {
> struct mdstat_ent *mse;
> @@ -674,7 +674,7 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
> continue;
> }
> close(fd);
> - st->next = statelist;
> + st->next = *statelist;
> st->err = 1;
> st->devnum = mse->devnum;
> st->percent = -2;
> @@ -685,7 +685,7 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state *statelist,
> devname2devnum(mse->metadata_version+10);
> else
> st->parent_dev = NoMdDev;
> - statelist = st;
> + *statelist = st;
> if (test)
> alert("TestMessage", st->devname, NULL, info);
> alert("NewArray", st->devname, NULL, info);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-01 11:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 10:37 [PATCH] Monitor: pass statelist reference when adding new arrays Czarnowska, Anna
2010-12-01 11:25 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).