* [PATCH 8/8] Kill unused parameter mddev in md_new_event_inintr().
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
@ 2008-03-23 15:05 ` Andre Noll
2008-03-23 15:10 ` [PATCH 7/8] sb_equal(): Fix misleading printk Andre Noll
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-23 15:05 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0d8f5a3..a601341 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
/* Alternate version that can be called from interrupts
* when calling sysfs_notify isn't needed.
*/
-static void md_new_event_inintr(mddev_t *mddev)
+static void md_new_event_inintr(void)
{
atomic_inc(&md_event_count);
wake_up(&md_event_waiters);
@@ -5031,7 +5031,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
- md_new_event_inintr(mddev);
+ md_new_event_inintr();
}
/* seq_file implementation /proc/mdstat */
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 7/8] sb_equal(): Fix misleading printk.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
2008-03-23 15:05 ` [PATCH 8/8] Kill unused parameter mddev in md_new_event_inintr() Andre Noll
@ 2008-03-23 15:10 ` Andre Noll
2008-03-23 18:34 ` [PATCH 6/8] Fix a typo in the comment to cmd_match() Andre Noll
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-23 15:10 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index fe4d9af..0d8f5a3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -564,7 +564,7 @@ static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
if (!tmp1 || !tmp2) {
ret = 0;
- printk(KERN_INFO "md.c: sb1 is not equal to sb2!\n");
+ printk(KERN_INFO "md.c sb_equal(): failed to allocate memory!\n");
goto abort;
}
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 6/8] Fix a typo in the comment to cmd_match().
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
2008-03-23 15:05 ` [PATCH 8/8] Kill unused parameter mddev in md_new_event_inintr() Andre Noll
2008-03-23 15:10 ` [PATCH 7/8] sb_equal(): Fix misleading printk Andre Noll
@ 2008-03-23 18:34 ` Andre Noll
2008-03-25 21:00 ` [PATCH 5/8] Fix typo in array_state comment Andre Noll
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-23 18:34 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index cdc381f..fe4d9af 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1787,7 +1787,7 @@ repeat:
}
-/* words written to sysfs files may, or my not, be \n terminated.
+/* words written to sysfs files may, or may not, be \n terminated.
* We want to accept with case. For this we use cmd_match.
*/
static int cmd_match(const char *cmd, const char *str)
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 5/8] Fix typo in array_state comment.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (2 preceding siblings ...)
2008-03-23 18:34 ` [PATCH 6/8] Fix a typo in the comment to cmd_match() Andre Noll
@ 2008-03-25 21:00 ` Andre Noll
2008-03-25 22:24 ` [PATCH 4/8] sync_speed_show(): Trivial cleanups Andre Noll
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-25 21:00 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 857af03..cdc381f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2512,7 +2512,7 @@ __ATTR(resync_start, S_IRUGO|S_IWUSR, resync_start_show, resync_start_store);
* When written, doesn't tear down array, but just stops it
* suspended (not supported yet)
* All IO requests will block. The array can be reconfigured.
- * Writing this, if accepted, will block until array is quiessent
+ * Writing this, if accepted, will block until array is quiescent
* readonly
* no resync can happen. no superblocks get written.
* write requests fail
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/8] sync_speed_show(): Trivial cleanups.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (3 preceding siblings ...)
2008-03-25 21:00 ` [PATCH 5/8] Fix typo in array_state comment Andre Noll
@ 2008-03-25 22:24 ` Andre Noll
2008-03-26 0:07 ` [PATCH 3/8] do_md_run(): Fix misleading error message Andre Noll
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-25 22:24 UTC (permalink / raw)
- Remove superfluous parentheses.
- Make format string match the type of the variable that is printed.
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2384266..857af03 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3049,11 +3049,11 @@ static ssize_t
sync_speed_show(mddev_t *mddev, char *page)
{
unsigned long resync, dt, db;
- resync = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active));
- dt = ((jiffies - mddev->resync_mark) / HZ);
+ resync = mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active);
+ dt = (jiffies - mddev->resync_mark) / HZ;
if (!dt) dt++;
- db = resync - (mddev->resync_mark_cnt);
- return sprintf(page, "%ld\n", db/dt/2); /* K/sec */
+ db = resync - mddev->resync_mark_cnt;
+ return sprintf(page, "%lu\n", db/dt/2); /* K/sec */
}
static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed);
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/8] do_md_run(): Fix misleading error message.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (4 preceding siblings ...)
2008-03-25 22:24 ` [PATCH 4/8] sync_speed_show(): Trivial cleanups Andre Noll
@ 2008-03-26 0:07 ` Andre Noll
2008-04-25 18:57 ` [PATCH 2/8] md_getgeo(): Move comment to proper position Andre Noll
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-03-26 0:07 UTC (permalink / raw)
In case pers->run() succeeds but creating the bitmap fails, we
print an error message stating that pers->run() has failed.
Print this message only if pers->run() really failed.
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f94ebe6..2384266 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3519,7 +3519,9 @@ static int do_md_run(mddev_t * mddev)
mddev->ro = 2; /* read-only, but switch on first write */
err = mddev->pers->run(mddev);
- if (!err && mddev->pers->sync_request) {
+ if (err)
+ printk(KERN_ERR "md: pers->run() failed ...\n");
+ else if (mddev->pers->sync_request) {
err = bitmap_create(mddev);
if (err) {
printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
@@ -3528,7 +3530,6 @@ static int do_md_run(mddev_t * mddev)
}
}
if (err) {
- printk(KERN_ERR "md: pers->run() failed ...\n");
module_put(mddev->pers->owner);
mddev->pers = NULL;
bitmap_destroy(mddev);
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/8] md_getgeo(): Move comment to proper position.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (5 preceding siblings ...)
2008-03-26 0:07 ` [PATCH 3/8] do_md_run(): Fix misleading error message Andre Noll
@ 2008-04-25 18:57 ` Andre Noll
2008-04-25 19:06 ` [PATCH 1/8] md_ioctl(): Fix misleading indentation Andre Noll
2008-07-08 1:06 ` [Patch 0/8] simple md.c cleanups Neil Brown
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-04-25 18:57 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b16d08d..f94ebe6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4641,6 +4641,12 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev)
return 0;
}
+/*
+ * We have a problem here : there is no easy way to give a CHS
+ * virtual geometry. We currently pretend that we have a 2 heads
+ * 4 sectors (with a BIG number of cylinders...). This drives
+ * dosfs just mad... ;-)
+ */
static int md_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
mddev_t *mddev = bdev->bd_disk->private_data;
@@ -4792,12 +4798,6 @@ static int md_ioctl(struct inode *inode, struct file *file,
err = do_md_stop (mddev, 1);
goto done_unlock;
- /*
- * We have a problem here : there is no easy way to give a CHS
- * virtual geometry. We currently pretend that we have a 2 heads
- * 4 sectors (with a BIG number of cylinders...). This drives
- * dosfs just mad... ;-)
- */
}
/*
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 1/8] md_ioctl(): Fix misleading indentation.
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (6 preceding siblings ...)
2008-04-25 18:57 ` [PATCH 2/8] md_getgeo(): Move comment to proper position Andre Noll
@ 2008-04-25 19:06 ` Andre Noll
2008-07-08 1:06 ` [Patch 0/8] simple md.c cleanups Neil Brown
8 siblings, 0 replies; 11+ messages in thread
From: Andre Noll @ 2008-04-25 19:06 UTC (permalink / raw)
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/md.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2580ac1..b16d08d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4807,13 +4807,11 @@ static int md_ioctl(struct inode *inode, struct file *file,
* here and hit the 'default' below, so only disallow
* 'md' ioctls, and switch to rw mode if started auto-readonly.
*/
- if (_IOC_TYPE(cmd) == MD_MAJOR &&
- mddev->ro && mddev->pers) {
+ if (_IOC_TYPE(cmd) == MD_MAJOR && mddev->ro && mddev->pers) {
if (mddev->ro == 2) {
mddev->ro = 0;
- set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
- md_wakeup_thread(mddev->thread);
-
+ set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+ md_wakeup_thread(mddev->thread);
} else {
err = -EROFS;
goto abort_unlock;
--
1.5.3.8
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [Patch 0/8] simple md.c cleanups
2008-07-07 7:55 [Patch 0/8] simple md.c cleanups Andre Noll
` (7 preceding siblings ...)
2008-04-25 19:06 ` [PATCH 1/8] md_ioctl(): Fix misleading indentation Andre Noll
@ 2008-07-08 1:06 ` Neil Brown
2008-07-08 9:48 ` Andre Noll
8 siblings, 1 reply; 11+ messages in thread
From: Neil Brown @ 2008-07-08 1:06 UTC (permalink / raw)
To: Andre Noll; +Cc: linux-raid
On Monday July 7, maan@systemlinux.org wrote:
> Hi
>
> here are eight simple cleanup patches to md.c against linus-current.git.
> Please review.
Thanks. I
- added "md: " to the start of the subject line
- fixed the conflicts with the first patch against my current tree:
I think I already fixed some of that indenting
- dropped the last patch.... I don't have a clear justification,
but I currently want to leave the 'mddev' parameter there to remind
me to review the implementation as I might want to do something
a bit different there ... not sure yet.
They are now in my "for-next" branch which can be viewed at
http://neil.brown.name/git?p=md;a=shortlog;h=refs/heads/for-next
NeilBrown
^ permalink raw reply [flat|nested] 11+ messages in thread