@@ -140,7 +140,7 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
#endif
static __inline__ int
-platform_discard_blocks(int fd, uint64_t start, uint64_t len)
+discard_blocks(int fd, uint64_t start, uint64_t len)
{
uint64_t range[2] = { start, len };
@@ -149,6 +149,11 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
return 0;
}
+static __inline__ int
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
+{
+ return discard_blocks(fd, start, len);
+}
#define ENOATTR ENODATA /* Attribute not found */
#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define EFSBADCRC EBADMSG /* Bad CRC detected */
@@ -1263,7 +1263,7 @@ done:
}
static void
-discard_blocks(dev_t dev, uint64_t nsectors, int quiet)
+discard_batch_of_blocks(dev_t dev, uint64_t nsectors, int quiet)
{
int fd;
uint64_t offset = 0;
@@ -1286,7 +1286,7 @@ discard_blocks(dev_t dev, uint64_t nsectors, int quiet)
* not necessary for the mkfs functionality but just an
* optimization. However we should stop on error.
*/
- if (platform_discard_blocks(fd, offset, tmp_step) == 0) {
+ if (discard_blocks(fd, offset, tmp_step) == 0) {
if (offset == 0 && !quiet) {
printf("Discarding blocks...");
fflush(stdout);
@@ -2664,11 +2664,11 @@ discard_devices(
*/
if (!xi->disfile)
- discard_blocks(xi->ddev, xi->dsize, quiet);
+ discard_batch_of_blocks(xi->ddev, xi->dsize, quiet);
if (xi->rtdev && !xi->risfile)
- discard_blocks(xi->rtdev, xi->rtsize, quiet);
+ discard_batch_of_blocks(xi->rtdev, xi->rtsize, quiet);
if (xi->logdev && xi->logdev != xi->ddev && !xi->lisfile)
- discard_blocks(xi->logdev, xi->logBBsize, quiet);
+ discard_batch_of_blocks(xi->logdev, xi->logBBsize, quiet);
}
static void