From fc86737f9158972172d41a9dfcba121efdb45ee4 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 2 Jul 2019 00:09:21 +0200 Subject: [PATCH] btrfs-progs: path-utils: rename is_existing_blk_or_reg_file Rename and add path_ prefix. Signed-off-by: David Sterba --- common/path-utils.c | 2 +- common/path-utils.h | 2 +- common/utils.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/path-utils.c b/common/path-utils.c index e85208a7..357df508 100644 --- a/common/path-utils.c +++ b/common/path-utils.c @@ -263,7 +263,7 @@ int is_same_loop_file(const char *a, const char *b) } /* Checks if a file exists and is a block or regular file*/ -int is_existing_blk_or_reg_file(const char *filename) +int path_is_reg_or_block_device(const char *filename) { struct stat st_buf; diff --git a/common/path-utils.h b/common/path-utils.h index 9231d886..279d88d6 100644 --- a/common/path-utils.h +++ b/common/path-utils.h @@ -33,7 +33,7 @@ int path_is_mount_point(const char *file); int path_exists(const char *file); int path_is_reg_file(const char *path); int is_same_loop_file(const char *a, const char *b); -int is_existing_blk_or_reg_file(const char *filename); +int path_is_reg_or_block_device(const char *filename); int test_issubvolname(const char *name); int test_isdir(const char *path); diff --git a/common/utils.c b/common/utils.c index 26229572..b0b4cc93 100644 --- a/common/utils.c +++ b/common/utils.c @@ -647,7 +647,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size, } else { /* ignore entries in the mount table that are not associated with a file*/ - if((ret = is_existing_blk_or_reg_file(mnt->mnt_fsname)) < 0) + if((ret = path_is_reg_or_block_device(mnt->mnt_fsname)) < 0) goto out_mntloop_err; else if(!ret) continue; @@ -1036,7 +1036,7 @@ int get_label(const char *btrfs_dev, char *label) { int ret; - ret = is_existing_blk_or_reg_file(btrfs_dev); + ret = path_is_reg_or_block_device(btrfs_dev); if (!ret) ret = get_label_mounted(btrfs_dev, label); else if (ret > 0) @@ -1052,7 +1052,7 @@ int set_label(const char *btrfs_dev, const char *label) if (check_label(label)) return -1; - ret = is_existing_blk_or_reg_file(btrfs_dev); + ret = path_is_reg_or_block_device(btrfs_dev); if (!ret) ret = set_label_mounted(btrfs_dev, label); else if (ret > 0)