From 78d742d876bdf7263d0d966fbe9593559fd904a7 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 21 Jun 2005 17:17:15 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/md/md.c') 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) 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"); -- cgit v1.2.2