From 221114c36f6f36e4232ca1c829c77ef5f98c8a5e Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 20 Feb 2024 12:38:36 +0100 Subject: [PATCH] btrfs-progs: drop verbosity parameter from btrfs_open_fd2() All calls now pass true, drop the parameter. Signed-off-by: David Sterba --- cmds/filesystem-du.c | 2 +- cmds/filesystem.c | 2 +- cmds/property.c | 2 +- common/open-utils.c | 18 +++++++++--------- common/open-utils.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmds/filesystem-du.c b/cmds/filesystem-du.c index 32ab1059..0ec877cd 100644 --- a/cmds/filesystem-du.c +++ b/cmds/filesystem-du.c @@ -456,7 +456,7 @@ static int du_add_file(const char *filename, int dirfd, ret = sprintf(pathp, "/%s", filename); pathp += ret; - fd = btrfs_open_fd2(path, true, false, false); + fd = btrfs_open_fd2(path, false, false); if (fd < 0) { ret = fd; goto out; diff --git a/cmds/filesystem.c b/cmds/filesystem.c index 4d325fa2..8ee17cbe 100644 --- a/cmds/filesystem.c +++ b/cmds/filesystem.c @@ -1150,7 +1150,7 @@ static int cmd_filesystem_defrag(const struct cmd_struct *cmd, struct stat st; int defrag_err = 0; - fd = btrfs_open_fd2(argv[i], true, defrag_open_mode == O_RDWR, false); + fd = btrfs_open_fd2(argv[i], defrag_open_mode == O_RDWR, false); if (fd < 0) { ret = fd; goto next; diff --git a/cmds/property.c b/cmds/property.c index 0afd6030..0969d58b 100644 --- a/cmds/property.c +++ b/cmds/property.c @@ -179,7 +179,7 @@ static int prop_compression(enum prop_object_type type, char *xattr_name = NULL; int open_flags = value ? O_RDWR : O_RDONLY; - fd = btrfs_open_fd2(object, true, open_flags == O_RDWR, false); + fd = btrfs_open_fd2(object, open_flags == O_RDWR, false); if (fd < 0) { ret = fd; goto out; diff --git a/common/open-utils.c b/common/open-utils.c index 4d3c56e8..406031e0 100644 --- a/common/open-utils.c +++ b/common/open-utils.c @@ -188,29 +188,29 @@ out: * * Return the file descriptor or -errno. */ -int btrfs_open_fd2(const char *path, bool verbose, bool read_write, bool dir_only) +int btrfs_open_fd2(const char *path, bool read_write, bool dir_only) { struct statfs stfs; struct stat st; int ret; if (stat(path, &st) < 0) { - error_on(verbose, "cannot access '%s': %m", path); + error("cannot access '%s': %m", path); return -errno; } if (dir_only && !S_ISDIR(st.st_mode)) { - error_on(verbose, "not a directory: %s", path); + error("not a directory: %s", path); return -ENOTDIR; } if (statfs(path, &stfs) < 0) { - error_on(verbose, "cannot access '%s': %m", path); + error("cannot access '%s': %m", path); return -errno; } if (stfs.f_type != BTRFS_SUPER_MAGIC) { - error_on(verbose, "not a btrfs filesystem: %s", path); + error("not a btrfs filesystem: %s", path); return -EINVAL; } @@ -220,7 +220,7 @@ int btrfs_open_fd2(const char *path, bool verbose, bool read_write, bool dir_onl ret = open(path, O_RDWR); if (ret < 0) { - error_on(verbose, "cannot access '%s': %m", path); + error("cannot access '%s': %m", path); ret = -errno; } @@ -229,12 +229,12 @@ int btrfs_open_fd2(const char *path, bool verbose, bool read_write, bool dir_onl int btrfs_open_file_or_dir_fd(const char *path) { - return btrfs_open_fd2(path, true, true, false); + return btrfs_open_fd2(path, true, false); } int btrfs_open_dir_fd(const char *path) { - return btrfs_open_fd2(path, true, true, true); + return btrfs_open_fd2(path, true, true); } /* @@ -254,7 +254,7 @@ int btrfs_open_mnt_fd(const char *path) error("'%s' is not a mounted btrfs device", path); return -EINVAL; } - ret = btrfs_open_fd2(mp, true, true, true); + ret = btrfs_open_fd2(mp, true, true); } else { ret = btrfs_open_dir_fd(path); } diff --git a/common/open-utils.h b/common/open-utils.h index 32ad3b00..249c7fbc 100644 --- a/common/open-utils.h +++ b/common/open-utils.h @@ -29,7 +29,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size, int check_mounted(const char* file); int get_btrfs_mount(const char *dev, char *mp, size_t mp_size); -int btrfs_open_fd2(const char *path, bool verbose, bool read_write, bool dir_only); +int btrfs_open_fd2(const char *path, bool read_write, bool dir_only); int btrfs_open_file_or_dir_fd(const char *path); int btrfs_open_dir_fd(const char *path); int btrfs_open_mnt_fd(const char *path);