summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-21 17:17:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 19:07:43 -0700
commit78d742d876bdf7263d0d966fbe9593559fd904a7 (patch)
tree00e700128a9ab1152958a53da1ee6ef48e358543 /drivers/md
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/md')
-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 34ffc133db0..b43bdb2c7e6 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -769,13 +769,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap)
chunks = bitmap->chunks;
file = bitmap->file;
- if (!file) { /* no file, dirty all the in-memory bits */
- printk(KERN_INFO "%s: no bitmap file, doing full recovery\n",
- bmname(bitmap));
- bitmap_set_memory_bits(bitmap, 0,
- chunks << CHUNK_BLOCK_SHIFT(bitmap), 1);
- return 0;
- }
+ BUG_ON(!file);
#if INJECT_FAULTS_3
outofdate = 1;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c402f6cc704..52fafb820f7 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)
seq_printf(seq, "\n ");
if ((bitmap = mddev->bitmap)) {
- char *buf, *path;
unsigned long chunk_kb;
unsigned long flags;
- buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
spin_lock_irqsave(&bitmap->lock, flags);
chunk_kb = bitmap->chunksize >> 10;
seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], "
@@ -3227,13 +3225,14 @@ static int md_seq_show(struct seq_file *seq, void *v)
<< (PAGE_SHIFT - 10),
chunk_kb ? chunk_kb : bitmap->chunksize,
chunk_kb ? "KB" : "B");
- if (bitmap->file && buf) {
- path = file_path(bitmap->file, buf, PAGE_SIZE);
- seq_printf(seq, ", file: %s", path ? path : "");
+ if (bitmap->file) {
+ seq_printf(seq, ", file: ");
+ seq_path(seq, bitmap->file->f_vfsmnt,
+ bitmap->file->f_dentry," \t\n");
}
+
seq_printf(seq, "\n");
spin_unlock_irqrestore(&bitmap->lock, flags);
- kfree(buf);
}
seq_printf(seq, "\n");