btrfs-progs: add prefix to exported queue_param

As this is a public helper, add a prefix that makes it clear what is the
queue related to.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-04-29 18:31:33 +02:00
parent 38254c4934
commit bc6864967b
4 changed files with 7 additions and 6 deletions

View File

@ -299,7 +299,7 @@ u64 get_partition_size(const char *dev)
/*
* Get a device request queue parameter from sysfs.
*/
int queue_param(const char *file, const char *param, char *buf, size_t len)
int device_get_queue_param(const char *file, const char *param, char *buf, size_t len)
{
blkid_probe probe;
char wholedisk[PATH_MAX];

View File

@ -32,6 +32,6 @@ u64 disk_size(const char *path);
u64 btrfs_device_size(int fd, struct stat *st);
int btrfs_prepare_device(int fd, const char *file, u64 *block_count_ret,
u64 max_block_count, unsigned opflags);
int queue_param(const char *file, const char *param, char *buf, size_t len);
int device_get_queue_param(const char *file, const char *param, char *buf, size_t len);
#endif

View File

@ -55,7 +55,7 @@ enum btrfs_zoned_model zoned_model(const char *file)
if (!S_ISBLK(st.st_mode))
return ZONED_NONE;
ret = queue_param(file, "zoned", model, sizeof(model));
ret = device_get_queue_param(file, "zoned", model, sizeof(model));
if (ret <= 0)
return ZONED_NONE;
@ -76,7 +76,7 @@ u64 zone_size(const char *file)
if (zoned_model(file) == ZONED_NONE)
return EMULATED_ZONE_SIZE;
ret = queue_param(file, "chunk_sectors", chunk, sizeof(chunk));
ret = device_get_queue_param(file, "chunk_sectors", chunk, sizeof(chunk));
if (ret <= 0)
return 0;
@ -88,7 +88,8 @@ u64 max_zone_append_size(const char *file)
char chunk[32];
int ret;
ret = queue_param(file, "zone_append_max_bytes", chunk, sizeof(chunk));
ret = device_get_queue_param(file, "zone_append_max_bytes", chunk,
sizeof(chunk));
if (ret <= 0)
return 0;

View File

@ -444,7 +444,7 @@ static int is_ssd(const char *file)
char rotational;
int ret;
ret = queue_param(file, "rotational", &rotational, 1);
ret = device_get_queue_param(file, "rotational", &rotational, 1);
if (ret < 1)
return 0;