1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Remove support for TRIM message

It's been unsupporte for now - and it's not going to be
implemented for thin pool kernel driver - so dropping
appearence of TRIM from libdm and lvm.
This commit is contained in:
Zdenek Kabelac 2012-03-02 13:26:08 +00:00
parent b804340f01
commit 6a5706a3a5
5 changed files with 1 additions and 33 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.73 -
====================================
Drop unsupported TRIM message for thin pool.
Improve logging for fifo startup in dmeventd.
Add few pointer validation in dmsetup.
Support dm_task_get_driver_version() query without version string.

View File

@ -70,7 +70,6 @@ int detach_pool_lv(struct lv_segment *seg)
switch (tmsg->type) {
case DM_THIN_MESSAGE_CREATE_SNAP:
case DM_THIN_MESSAGE_CREATE_THIN:
case DM_THIN_MESSAGE_TRIM:
if (tmsg->u.lv == seg->lv) {
log_debug("Discarding message for LV %s.",
tmsg->u.lv->name);
@ -151,7 +150,6 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
switch (type) {
case DM_THIN_MESSAGE_CREATE_SNAP:
case DM_THIN_MESSAGE_CREATE_THIN:
case DM_THIN_MESSAGE_TRIM:
tmsg->u.lv = lv;
break;
case DM_THIN_MESSAGE_DELETE:
@ -173,7 +171,6 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
log_debug("Added %s message",
(type == DM_THIN_MESSAGE_CREATE_SNAP ||
type == DM_THIN_MESSAGE_CREATE_THIN) ? "create" :
(type == DM_THIN_MESSAGE_TRIM) ? "trim" :
(type == DM_THIN_MESSAGE_DELETE) ? "delete" : "unknown");
return 1;
@ -200,7 +197,6 @@ int pool_has_message(const struct lv_segment *seg,
switch (tmsg->type) {
case DM_THIN_MESSAGE_CREATE_SNAP:
case DM_THIN_MESSAGE_CREATE_THIN:
case DM_THIN_MESSAGE_TRIM:
if (tmsg->u.lv == lv)
return 1;
break;

View File

@ -62,15 +62,6 @@ static int _thin_pool_add_message(struct lv_segment *seg,
type = DM_THIN_MESSAGE_CREATE_THIN;
}
if (dm_config_get_str(sn, "trim", &lv_name)) {
if (lv)
return SEG_LOG_ERROR("Unsupported message format in");
if (!(lv = find_lv(seg->lv->vg, lv_name)))
return SEG_LOG_ERROR("Unknown LV %s for trim message in",
lv_name);
type = DM_THIN_MESSAGE_TRIM;
}
if (!dm_config_get_uint32(sn, "delete", &delete_id)) {
if (!lv)
return SEG_LOG_ERROR("Unknown message in");
@ -169,7 +160,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
switch (tmsg->type) {
case DM_THIN_MESSAGE_CREATE_SNAP:
case DM_THIN_MESSAGE_CREATE_THIN:
case DM_THIN_MESSAGE_TRIM:
if (!lv_is_thin_volume(tmsg->u.lv)) {
log_error(INTERNAL_ERROR
"LV %s is not a thin volume.",
@ -192,9 +182,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
case DM_THIN_MESSAGE_CREATE_THIN:
outf(f, "create = \"%s\"", tmsg->u.lv->name);
break;
case DM_THIN_MESSAGE_TRIM:
outf(f, "trim = \"%s\"", tmsg->u.lv->name);
break;
case DM_THIN_MESSAGE_DELETE:
outf(f, "delete = %d", tmsg->u.delete_id);
break;
@ -302,10 +289,6 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
lmsg->u.delete_id, 0))
return_0;
break;
case DM_THIN_MESSAGE_TRIM:
/* FIXME: to be implemented */
log_error("Sorry TRIM is not yet supported.");
return 0;
default:
log_error(INTERNAL_ERROR "Unsupported message.");
return 0;

View File

@ -650,7 +650,6 @@ typedef enum {
DM_THIN_MESSAGE_CREATE_THIN, /* device_id */
DM_THIN_MESSAGE_DELETE, /* device_id */
DM_THIN_MESSAGE_SET_TRANSACTION_ID, /* current_id, new_id */
DM_THIN_MESSAGE_TRIM /* device_id, new_size */
} dm_thin_message_t;
int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,

View File

@ -1404,11 +1404,6 @@ static int _thin_pool_node_message(struct dm_tree_node *dnode, struct thin_messa
r = dm_snprintf(buf, sizeof(buf), "delete %u",
m->u.m_delete.device_id);
break;
case DM_THIN_MESSAGE_TRIM:
r = dm_snprintf(buf, sizeof(buf), "trim %u %" PRIu64,
m->u.m_trim.device_id,
m->u.m_trim.new_size);
break;
case DM_THIN_MESSAGE_SET_TRANSACTION_ID:
r = dm_snprintf(buf, sizeof(buf),
"set_transaction_id %" PRIu64 " %" PRIu64,
@ -3051,12 +3046,6 @@ int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
tm->message.u.m_delete.device_id = id1;
tm->expected_errno = ENODATA;
break;
case DM_THIN_MESSAGE_TRIM:
if (!_thin_validate_device_id(id1))
return_0;
tm->message.u.m_trim.device_id = id1;
tm->message.u.m_trim.new_size = id2;
break;
case DM_THIN_MESSAGE_SET_TRANSACTION_ID:
if ((id1 + 1) != id2) {
log_error("New transaction id must be sequential.");