mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libdasd: Provide function to utilise release space ioctl
The BIODASDRAS (Release Allocated Space) ioctl allows to release track-wise or full space of an Extent Space Efficient DASD volume. Provide a library function to utilise this functionality. Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -228,6 +228,26 @@ int dasd_check_format(const char *device, format_check_t *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Release Allocated Space
|
||||
*
|
||||
* @param[in] fd device node's file descriptor
|
||||
* @param[in] r format options
|
||||
*
|
||||
* @retval 0 in case of success
|
||||
* @retval errno in case of failure
|
||||
*/
|
||||
int dasd_release_space(const char *device, format_data_t *r)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = dasd_open_device(device, O_RDONLY);
|
||||
RUN_IOCTL(fd, BIODASDRAS, r);
|
||||
dasd_close_device(fd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reread partition table
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user