Commit 6bcfd601 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

md: kill file_path wrapper

Kill the trivial and rather pointless file_path wrapper around d_path.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 03de250a
...@@ -203,17 +203,6 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) ...@@ -203,17 +203,6 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
* bitmap file handling - read and write the bitmap file and its superblock * bitmap file handling - read and write the bitmap file and its superblock
*/ */
/* copy the pathname of a file to a buffer */
char *file_path(struct file *file, char *buf, int count)
{
if (!buf)
return NULL;
buf = d_path(&file->f_path, buf, count);
return IS_ERR(buf) ? NULL : buf;
}
/* /*
* basic page I/O operations * basic page I/O operations
*/ */
...@@ -721,11 +710,13 @@ static void bitmap_file_kick(struct bitmap *bitmap) ...@@ -721,11 +710,13 @@ static void bitmap_file_kick(struct bitmap *bitmap)
if (bitmap->file) { if (bitmap->file) {
path = kmalloc(PAGE_SIZE, GFP_KERNEL); path = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (path) if (path)
ptr = file_path(bitmap->file, path, PAGE_SIZE); ptr = d_path(&bitmap->file->f_path, path,
PAGE_SIZE);
printk(KERN_ALERT printk(KERN_ALERT
"%s: kicking failed bitmap file %s from array!\n", "%s: kicking failed bitmap file %s from array!\n",
bmname(bitmap), ptr ? ptr : ""); bmname(bitmap), IS_ERR(ptr) ? "" : ptr);
kfree(path); kfree(path);
} else } else
......
...@@ -3987,8 +3987,8 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg) ...@@ -3987,8 +3987,8 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
if (!buf) if (!buf)
goto out; goto out;
ptr = file_path(mddev->bitmap->file, buf, sizeof(file->pathname)); ptr = d_path(&mddev->bitmap->file->f_path, buf, sizeof(file->pathname));
if (!ptr) if (IS_ERR(ptr))
goto out; goto out;
strcpy(file->pathname, ptr); strcpy(file->pathname, ptr);
......
...@@ -262,7 +262,6 @@ int bitmap_create(mddev_t *mddev); ...@@ -262,7 +262,6 @@ int bitmap_create(mddev_t *mddev);
void bitmap_flush(mddev_t *mddev); void bitmap_flush(mddev_t *mddev);
void bitmap_destroy(mddev_t *mddev); void bitmap_destroy(mddev_t *mddev);
char *file_path(struct file *file, char *buf, int count);
void bitmap_print_sb(struct bitmap *bitmap); void bitmap_print_sb(struct bitmap *bitmap);
void bitmap_update_sb(struct bitmap *bitmap); void bitmap_update_sb(struct bitmap *bitmap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment