Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

md: kill file_path wrapper

Kill the trivial and rather pointless file_path wrapper around d_path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
6bcfd601 03de250a

+6 -16
+4 -13
drivers/md/bitmap.c
··· 203 203 * bitmap file handling - read and write the bitmap file and its superblock 204 204 */ 205 205 206 - /* copy the pathname of a file to a buffer */ 207 - char *file_path(struct file *file, char *buf, int count) 208 - { 209 - if (!buf) 210 - return NULL; 211 - 212 - buf = d_path(&file->f_path, buf, count); 213 - 214 - return IS_ERR(buf) ? NULL : buf; 215 - } 216 - 217 206 /* 218 207 * basic page I/O operations 219 208 */ ··· 710 721 if (bitmap->file) { 711 722 path = kmalloc(PAGE_SIZE, GFP_KERNEL); 712 723 if (path) 713 - ptr = file_path(bitmap->file, path, PAGE_SIZE); 724 + ptr = d_path(&bitmap->file->f_path, path, 725 + PAGE_SIZE); 726 + 714 727 715 728 printk(KERN_ALERT 716 729 "%s: kicking failed bitmap file %s from array!\n", 717 - bmname(bitmap), ptr ? ptr : ""); 730 + bmname(bitmap), IS_ERR(ptr) ? "" : ptr); 718 731 719 732 kfree(path); 720 733 } else
+2 -2
drivers/md/md.c
··· 3987 3987 if (!buf) 3988 3988 goto out; 3989 3989 3990 - ptr = file_path(mddev->bitmap->file, buf, sizeof(file->pathname)); 3991 - if (!ptr) 3990 + ptr = d_path(&mddev->bitmap->file->f_path, buf, sizeof(file->pathname)); 3991 + if (IS_ERR(ptr)) 3992 3992 goto out; 3993 3993 3994 3994 strcpy(file->pathname, ptr);
-1
include/linux/raid/bitmap.h
··· 262 262 void bitmap_flush(mddev_t *mddev); 263 263 void bitmap_destroy(mddev_t *mddev); 264 264 265 - char *file_path(struct file *file, char *buf, int count); 266 265 void bitmap_print_sb(struct bitmap *bitmap); 267 266 void bitmap_update_sb(struct bitmap *bitmap); 268 267