aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-21 20:17:15 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:43 -0400
commit78d742d876bdf7263d0d966fbe9593559fd904a7 (patch)
tree00e700128a9ab1152958a53da1ee6ef48e358543 /drivers
parent32a7627cf3a35396a8e834faf34e38ae9f3b1309 (diff)
[PATCH] md: a couple of tidyups relating to the bitmap file.
1/ When init from disk, it is a BUG if there is nowhere to init from, 2/ use seq_path to print path in /proc/mdstat Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/bitmap.c8
-rw-r--r--drivers/md/md.c11
2 files changed, 6 insertions, 13 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 34ffc133db05..b43bdb2c7e64 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -769,13 +769,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap)
769 chunks = bitmap->chunks; 769 chunks = bitmap->chunks;
770 file = bitmap->file; 770 file = bitmap->file;
771 771
772 if (!file) { /* no file, dirty all the in-memory bits */ 772 BUG_ON(!file);
773 printk(KERN_INFO "%s: no bitmap file, doing full recovery\n",
774 bmname(bitmap));
775 bitmap_set_memory_bits(bitmap, 0,
776 chunks << CHUNK_BLOCK_SHIFT(bitmap), 1);
777 return 0;
778 }
779 773
780#if INJECT_FAULTS_3 774#if INJECT_FAULTS_3
781 outofdate = 1; 775 outofdate = 1;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c402f6cc7047..52fafb820f74 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3213,10 +3213,8 @@ static int md_seq_show(struct seq_file *seq, void *v)
3213 seq_printf(seq, "\n "); 3213 seq_printf(seq, "\n ");
3214 3214
3215 if ((bitmap = mddev->bitmap)) { 3215 if ((bitmap = mddev->bitmap)) {
3216 char *buf, *path;
3217 unsigned long chunk_kb; 3216 unsigned long chunk_kb;
3218 unsigned long flags; 3217 unsigned long flags;
3219 buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
3220 spin_lock_irqsave(&bitmap->lock, flags); 3218 spin_lock_irqsave(&bitmap->lock, flags);
3221 chunk_kb = bitmap->chunksize >> 10; 3219 chunk_kb = bitmap->chunksize >> 10;
3222 seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], " 3220 seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], "
@@ -3227,13 +3225,14 @@ static int md_seq_show(struct seq_file *seq, void *v)
3227 << (PAGE_SHIFT - 10), 3225 << (PAGE_SHIFT - 10),
3228 chunk_kb ? chunk_kb : bitmap->chunksize, 3226 chunk_kb ? chunk_kb : bitmap->chunksize,
3229 chunk_kb ? "KB" : "B"); 3227 chunk_kb ? "KB" : "B");
3230 if (bitmap->file && buf) { 3228 if (bitmap->file) {
3231 path = file_path(bitmap->file, buf, PAGE_SIZE); 3229 seq_printf(seq, ", file: ");
3232 seq_printf(seq, ", file: %s", path ? path : ""); 3230 seq_path(seq, bitmap->file->f_vfsmnt,
3231 bitmap->file->f_dentry," \t\n");
3233 } 3232 }
3233
3234 seq_printf(seq, "\n"); 3234 seq_printf(seq, "\n");
3235 spin_unlock_irqrestore(&bitmap->lock, flags); 3235 spin_unlock_irqrestore(&bitmap->lock, flags);
3236 kfree(buf);
3237 } 3236 }
3238 3237
3239 seq_printf(seq, "\n"); 3238 seq_printf(seq, "\n");