diff options
author | Hunter Shaffer <huntershaffer182456@gmail.com> | 2023-08-29 17:32:55 -0400 |
---|---|---|
committer | Hunter Shaffer <huntershaffer182456@gmail.com> | 2023-10-08 21:06:07 -0400 |
commit | b2ffa12074f1a6060b715e0891c1efb3ee64be68 (patch) | |
tree | be747d1b4d0a3e76da2bee78d69dd88272da7c9b | |
parent | 1251ea58a84e365db3754e6f5f57bd442484dc89 (diff) |
deleted unused path to device in get_size, get_blocksize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
-rw-r--r-- | cmd_device.c | 2 | ||||
-rw-r--r-- | cmd_migrate.c | 4 | ||||
-rw-r--r-- | libbcachefs.c | 4 | ||||
-rw-r--r-- | qcow2.c | 2 | ||||
-rw-r--r-- | tools-util.c | 4 | ||||
-rw-r--r-- | tools-util.h | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/cmd_device.c b/cmd_device.c index d0a3e72..3d67e3e 100644 --- a/cmd_device.c +++ b/cmd_device.c @@ -484,7 +484,7 @@ int cmd_device_resize(int argc, char *argv[]) char *size_arg = arg_pop(); if (!size_arg) - size = get_size(dev, dev_fd); + size = get_size(dev_fd); else if (bch2_strtoull_h(size_arg, &size)) die("invalid size"); diff --git a/cmd_migrate.c b/cmd_migrate.c index 85ab96c..efacc50 100644 --- a/cmd_migrate.c +++ b/cmd_migrate.c @@ -671,7 +671,7 @@ static int migrate_fs(const char *fs_path, dev.path = dev_t_to_path(stat.st_dev); dev.fd = xopen(dev.path, O_RDWR); - opt_set(fs_opts, block_size, get_blocksize(dev.path, dev.fd)); + opt_set(fs_opts, block_size, get_blocksize(dev.fd)); char *file_path = mprintf("%s/bcachefs", fs_path); printf("Creating new filesystem on %s in space reserved at %s\n", @@ -682,7 +682,7 @@ static int migrate_fs(const char *fs_path, u64 bcachefs_inum; ranges extents = reserve_new_fs_space(file_path, fs_opts.block_size >> 9, - get_size(dev.path, dev.fd) / 5, + get_size(dev.fd) / 5, &bcachefs_inum, stat.st_dev, force); find_superblock_space(extents, format_opts, &dev); diff --git a/libbcachefs.c b/libbcachefs.c index aac5084..575cce4 100644 --- a/libbcachefs.c +++ b/libbcachefs.c @@ -67,7 +67,7 @@ static u64 min_size(unsigned bucket_size) void bch2_pick_bucket_size(struct bch_opts opts, struct dev_opts *dev) { if (!dev->size) - dev->size = get_size(dev->path, dev->fd); + dev->size = get_size(dev->fd); if (!dev->bucket_size) { if (dev->size < min_size(opts.block_size)) @@ -155,7 +155,7 @@ struct bch_sb *bch2_format(struct bch_opt_strs fs_opt_strs, for (i = devs; i < devs + nr_devs; i++) max_dev_block_size = max(max_dev_block_size, - get_blocksize(i->path, i->fd)); + get_blocksize(i->fd)); /* calculate block size: */ if (!opt_defined(fs_opts, block_size)) { @@ -72,7 +72,7 @@ static void add_l2(struct qcow2_image *img, u64 src_blk, u64 dst_offset) void qcow2_write_image(int infd, int outfd, ranges *data, unsigned block_size) { - u64 image_size = get_size(NULL, infd); + u64 image_size = get_size(infd); unsigned l2_size = block_size / sizeof(u64); unsigned l1_size = DIV_ROUND_UP(image_size, (u64) block_size * l2_size); struct qcow2_hdr hdr = { 0 }; diff --git a/tools-util.c b/tools-util.c index 81ce63a..9b18373 100644 --- a/tools-util.c +++ b/tools-util.c @@ -186,7 +186,7 @@ ssize_t read_string_list_or_die(const char *opt, const char * const list[], } /* Returns size of file or block device: */ -u64 get_size(const char *path, int fd) +u64 get_size(int fd) { struct stat statbuf = xfstat(fd); @@ -199,7 +199,7 @@ u64 get_size(const char *path, int fd) } /* Returns blocksize, in bytes: */ -unsigned get_blocksize(const char *path, int fd) +unsigned get_blocksize(int fd) { struct stat statbuf = xfstat(fd); diff --git a/tools-util.h b/tools-util.h index e7bdd2c..dafd791 100644 --- a/tools-util.h +++ b/tools-util.h @@ -62,8 +62,8 @@ u64 read_file_u64(int, const char *); ssize_t read_string_list_or_die(const char *, const char * const[], const char *); -u64 get_size(const char *, int); -unsigned get_blocksize(const char *, int); +u64 get_size(int); +unsigned get_blocksize(int); int open_for_format(const char *, bool); bool ask_yn(void); |