mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-13 01:01:13 +00:00
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:
parent
38254c4934
commit
bc6864967b
@ -299,7 +299,7 @@ u64 get_partition_size(const char *dev)
|
|||||||
/*
|
/*
|
||||||
* Get a device request queue parameter from sysfs.
|
* 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;
|
blkid_probe probe;
|
||||||
char wholedisk[PATH_MAX];
|
char wholedisk[PATH_MAX];
|
||||||
|
@ -32,6 +32,6 @@ u64 disk_size(const char *path);
|
|||||||
u64 btrfs_device_size(int fd, struct stat *st);
|
u64 btrfs_device_size(int fd, struct stat *st);
|
||||||
int btrfs_prepare_device(int fd, const char *file, u64 *block_count_ret,
|
int btrfs_prepare_device(int fd, const char *file, u64 *block_count_ret,
|
||||||
u64 max_block_count, unsigned opflags);
|
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
|
#endif
|
||||||
|
@ -55,7 +55,7 @@ enum btrfs_zoned_model zoned_model(const char *file)
|
|||||||
if (!S_ISBLK(st.st_mode))
|
if (!S_ISBLK(st.st_mode))
|
||||||
return ZONED_NONE;
|
return ZONED_NONE;
|
||||||
|
|
||||||
ret = queue_param(file, "zoned", model, sizeof(model));
|
ret = device_get_queue_param(file, "zoned", model, sizeof(model));
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return ZONED_NONE;
|
return ZONED_NONE;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ u64 zone_size(const char *file)
|
|||||||
if (zoned_model(file) == ZONED_NONE)
|
if (zoned_model(file) == ZONED_NONE)
|
||||||
return EMULATED_ZONE_SIZE;
|
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)
|
if (ret <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -88,7 +88,8 @@ u64 max_zone_append_size(const char *file)
|
|||||||
char chunk[32];
|
char chunk[32];
|
||||||
int ret;
|
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)
|
if (ret <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ static int is_ssd(const char *file)
|
|||||||
char rotational;
|
char rotational;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = queue_param(file, "rotational", &rotational, 1);
|
ret = device_get_queue_param(file, "rotational", &rotational, 1);
|
||||||
if (ret < 1)
|
if (ret < 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user