mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Use structure copy
Since the code evolved a bit with current structures we could use C to copy struct members.
This commit is contained in:
parent
759b9592ba
commit
2a0d806b3c
@ -2906,26 +2906,24 @@ int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
|
|||||||
if (!_thin_validate_device_id(message->u.m_create_snap.device_id) ||
|
if (!_thin_validate_device_id(message->u.m_create_snap.device_id) ||
|
||||||
!_thin_validate_device_id(message->u.m_create_snap.origin_id))
|
!_thin_validate_device_id(message->u.m_create_snap.origin_id))
|
||||||
return_0;
|
return_0;
|
||||||
tm->message.u.m_create_snap.device_id = message->u.m_create_snap.device_id;
|
tm->message.u.m_create_snap = message->u.m_create_snap;
|
||||||
tm->message.u.m_create_snap.origin_id = message->u.m_create_snap.origin_id;
|
|
||||||
break;
|
break;
|
||||||
case DM_THIN_MESSAGE_CREATE_THIN:
|
case DM_THIN_MESSAGE_CREATE_THIN:
|
||||||
if (!_thin_validate_device_id(message->u.m_create_thin.device_id))
|
if (!_thin_validate_device_id(message->u.m_create_thin.device_id))
|
||||||
return_0;
|
return_0;
|
||||||
tm->message.u.m_create_thin.device_id = message->u.m_create_thin.device_id;
|
tm->message.u.m_create_thin = message->u.m_create_thin;
|
||||||
tm->expected_errno = EEXIST;
|
tm->expected_errno = EEXIST;
|
||||||
break;
|
break;
|
||||||
case DM_THIN_MESSAGE_DELETE:
|
case DM_THIN_MESSAGE_DELETE:
|
||||||
if (!_thin_validate_device_id(message->u.m_delete.device_id))
|
if (!_thin_validate_device_id(message->u.m_delete.device_id))
|
||||||
return_0;
|
return_0;
|
||||||
tm->message.u.m_delete.device_id = message->u.m_delete.device_id;
|
tm->message.u.m_delete = message->u.m_delete;
|
||||||
tm->expected_errno = ENODATA;
|
tm->expected_errno = ENODATA;
|
||||||
break;
|
break;
|
||||||
case DM_THIN_MESSAGE_TRIM:
|
case DM_THIN_MESSAGE_TRIM:
|
||||||
if (!_thin_validate_device_id(message->u.m_trim.device_id))
|
if (!_thin_validate_device_id(message->u.m_trim.device_id))
|
||||||
return_0;
|
return_0;
|
||||||
tm->message.u.m_trim.device_id = message->u.m_trim.device_id;
|
tm->message.u.m_trim = message->u.m_trim;
|
||||||
tm->message.u.m_trim.new_size = message->u.m_trim.new_size;
|
|
||||||
break;
|
break;
|
||||||
case DM_THIN_MESSAGE_SET_TRANSACTION_ID:
|
case DM_THIN_MESSAGE_SET_TRANSACTION_ID:
|
||||||
if (message->u.m_set_transaction_id.current_id !=
|
if (message->u.m_set_transaction_id.current_id !=
|
||||||
@ -2933,10 +2931,7 @@ int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
|
|||||||
log_error("New transaction_id must be sequential.");
|
log_error("New transaction_id must be sequential.");
|
||||||
return 0; /* FIXME: Maybe too strict here? */
|
return 0; /* FIXME: Maybe too strict here? */
|
||||||
}
|
}
|
||||||
tm->message.u.m_set_transaction_id.current_id =
|
tm->message.u.m_set_transaction_id = message->u.m_set_transaction_id;
|
||||||
message->u.m_set_transaction_id.current_id;
|
|
||||||
tm->message.u.m_set_transaction_id.new_id =
|
|
||||||
message->u.m_set_transaction_id.new_id;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log_error("Unsupported message type %d.", (int) message->type);
|
log_error("Unsupported message type %d.", (int) message->type);
|
||||||
|
Loading…
Reference in New Issue
Block a user