1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-05 16:16:45 +03:00

fix ioctls to use long not int

update dm-ioctl.h after compat tidy-up
This commit is contained in:
Alasdair Kergon 2007-12-05 14:11:26 +00:00
parent 8a0a9a93d9
commit fec8f8382a
2 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.23 -
==================================
Update dm-ioctl.h after removal of compat code.
Add --readahead to dmsetup.
Add external read_ahead library functions and DM_READ_AHEAD_* definitions.
Fix double free in a libdevmapper-event error path.

View File

@ -380,17 +380,19 @@ int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead)
{
int r = 1;
int fd;
long read_ahead_long;
if ((fd = _open_dev_node(dev_name)) < 0)
return_0;
*read_ahead = 0;
if (ioctl(fd, BLKRAGET, read_ahead)) {
if (ioctl(fd, BLKRAGET, &read_ahead_long)) {
log_sys_error("BLKRAGET", dev_name);
*read_ahead = 0;
r = 0;
} else
} else {
*read_ahead = (uint32_t) read_ahead_long;
log_debug("%s: read ahead is %" PRIu32, dev_name, *read_ahead);
}
if (close(fd))
stack;
@ -402,13 +404,14 @@ static int _set_read_ahead(const char *dev_name, uint32_t read_ahead)
{
int r = 1;
int fd;
long read_ahead_long = (long) read_ahead;
if ((fd = _open_dev_node(dev_name)) < 0)
return_0;
log_debug("%s: Setting read ahead to %" PRIu32, dev_name, read_ahead);
if (ioctl(fd, BLKRASET, read_ahead)) {
if (ioctl(fd, BLKRASET, read_ahead_long)) {
log_sys_error("BLKRASET", dev_name);
r = 0;
}