From 9fcc893624dc4c9f2617fbf6827d7df3537d5452 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 22 Jan 2019 11:12:42 +0100 Subject: lib/loopdev: differentiate between setter()s and ioctl calls Now the internal API uses loopcxt_set_...() to set context variables as well as to call ioctls. This patch introduces loopcxt_ioctl_...() to makes things more obvious to readers. Signed-off-by: Karel Zak --- lib/loopdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/loopdev.c b/lib/loopdev.c index de0d50ba2..556c4df26 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -1216,7 +1216,7 @@ static int loopcxt_check_size(struct loopdev_cxt *lc, int file_fd) "size mismatch (%ju/%ju)", size, expected_size)); - if (loopcxt_set_capacity(lc)) { + if (loopcxt_ioctl_capacity(lc)) { /* ioctl not available */ if (errno == ENOTTY || errno == EINVAL) errno = ERANGE; @@ -1374,7 +1374,7 @@ err: * * Returns: <0 on error, 0 on success. */ -int loopcxt_set_status(struct loopdev_cxt *lc) +int loopcxt_ioctl_status(struct loopdev_cxt *lc) { int dev_fd, rc = -1; @@ -1397,7 +1397,7 @@ int loopcxt_set_status(struct loopdev_cxt *lc) return 0; } -int loopcxt_set_capacity(struct loopdev_cxt *lc) +int loopcxt_ioctl_capacity(struct loopdev_cxt *lc) { int fd = loopcxt_get_fd(lc); @@ -1415,7 +1415,7 @@ int loopcxt_set_capacity(struct loopdev_cxt *lc) return 0; } -int loopcxt_set_dio(struct loopdev_cxt *lc, unsigned long use_dio) +int loopcxt_ioctl_dio(struct loopdev_cxt *lc, unsigned long use_dio) { int fd = loopcxt_get_fd(lc); @@ -1437,7 +1437,7 @@ int loopcxt_set_dio(struct loopdev_cxt *lc, unsigned long use_dio) * Kernel uses "unsigned long" as ioctl arg, but we use u64 for all sizes to * keep loopdev internal API simple. */ -int loopcxt_set_blocksize(struct loopdev_cxt *lc, uint64_t blocksize) +int loopcxt_ioctl_blocksize(struct loopdev_cxt *lc, uint64_t blocksize) { int fd = loopcxt_get_fd(lc); -- cgit v1.2.3-55-g7522