1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-14 13:34:43 +03:00
This commit is contained in:
Alasdair Kergon 2007-12-03 22:48:36 +00:00
parent fd0af4bd29
commit 0b7d16bc09
4 changed files with 16 additions and 6 deletions

View File

@ -1281,7 +1281,9 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
dmt->major, dmt->minor, dmi->name);
}
if (dmt->dev_name)
/* FIXME Until resume ioctl supplies name, use dev_name for readahead */
if (dmt->dev_name && (dmt->type != DM_DEVICE_RESUME || dmt->minor < 0 ||
dmt->major < 0))
strncpy(dmi->name, dmt->dev_name, sizeof(dmi->name));
if (dmt->uuid)
@ -1683,7 +1685,8 @@ repeat_ioctl:
break;
case DM_DEVICE_RESUME:
set_dev_node_read_ahead(dmi->name, dmt->read_ahead,
/* FIXME Kernel needs to fill in dmi->name */
set_dev_node_read_ahead(dmt->dev_name, dmt->read_ahead,
dmt->read_ahead_flags);
break;

View File

@ -386,13 +386,13 @@ int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead)
*read_ahead = 0;
if (!ioctl(fd, BLKRAGET, read_ahead)) {
if (ioctl(fd, BLKRAGET, read_ahead)) {
log_sys_error("BLKRAGET", dev_name);
r = 0;
} else
log_debug("%s: read ahead is %" PRIu32, dev_name, *read_ahead);
if (!close(fd))
if (close(fd))
stack;
return r;
@ -413,7 +413,7 @@ static int _set_read_ahead(const char *dev_name, uint32_t read_ahead)
r = 0;
}
if (!close(fd))
if (close(fd))
stack;
return r;

View File

@ -901,6 +901,13 @@ static int _resume_node(const char *name, uint32_t major, uint32_t minor,
return 0;
}
/* FIXME Kernel should fill in name on return instead */
if (!dm_task_set_name(dmt, name)) {
log_error("Failed to set readahead device name for %s", name);
dm_task_destroy(dmt);
return 0;
}
if (!dm_task_set_major(dmt, major) || !dm_task_set_minor(dmt, minor)) {
log_error("Failed to set device number for %s resumption.", name);
dm_task_destroy(dmt);

View File

@ -340,7 +340,7 @@ static void _display_info_long(struct dm_task *dmt, struct dm_info *info)
info->read_only ? " (READ-ONLY)" : "");
if (dm_task_get_read_ahead(dmt, &read_ahead))
printf("Read Ahead: %" PRIu32 "\n", read_ahead);
printf("Read Ahead: %" PRIu32 "\n", read_ahead);
if (!info->live_table && !info->inactive_table)
printf("Tables present: None\n");