drbd: Add struct drbd_device->resource
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
This commit is contained in:
parent
a10f6b8ae6
commit
d8628a8657
|
@ -631,6 +631,7 @@ struct drbd_peer_device {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct drbd_device {
|
struct drbd_device {
|
||||||
|
struct drbd_resource *resource;
|
||||||
struct list_head peer_devices;
|
struct list_head peer_devices;
|
||||||
int vnr; /* volume number within the connection */
|
int vnr; /* volume number within the connection */
|
||||||
struct kref kref;
|
struct kref kref;
|
||||||
|
|
|
@ -2681,6 +2681,7 @@ enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigne
|
||||||
INIT_LIST_HEAD(&device->peer_devices);
|
INIT_LIST_HEAD(&device->peer_devices);
|
||||||
list_add(&peer_device->peer_devices, &device->peer_devices);
|
list_add(&peer_device->peer_devices, &device->peer_devices);
|
||||||
kref_get(&connection->kref);
|
kref_get(&connection->kref);
|
||||||
|
device->resource = connection->resource;
|
||||||
peer_device->connection = connection;
|
peer_device->connection = connection;
|
||||||
peer_device->device = device;
|
peer_device->device = device;
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
|
||||||
first_peer_device(adm_ctx.device)->connection != adm_ctx.connection) {
|
first_peer_device(adm_ctx.device)->connection != adm_ctx.connection) {
|
||||||
pr_warning("request: minor=%u, resource=%s; but that minor belongs to connection %s\n",
|
pr_warning("request: minor=%u, resource=%s; but that minor belongs to connection %s\n",
|
||||||
adm_ctx.minor, adm_ctx.resource_name,
|
adm_ctx.minor, adm_ctx.resource_name,
|
||||||
first_peer_device(adm_ctx.device)->connection->resource->name);
|
adm_ctx.device->resource->name);
|
||||||
drbd_msg_put_info("minor exists in different resource");
|
drbd_msg_put_info("minor exists in different resource");
|
||||||
return ERR_INVALID_REQUEST;
|
return ERR_INVALID_REQUEST;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
|
||||||
pr_warning("request: minor=%u, volume=%u; but that minor is volume %u in %s\n",
|
pr_warning("request: minor=%u, volume=%u; but that minor is volume %u in %s\n",
|
||||||
adm_ctx.minor, adm_ctx.volume,
|
adm_ctx.minor, adm_ctx.volume,
|
||||||
adm_ctx.device->vnr,
|
adm_ctx.device->vnr,
|
||||||
first_peer_device(adm_ctx.device)->connection->resource->name);
|
adm_ctx.device->resource->name);
|
||||||
drbd_msg_put_info("minor exists as different volume");
|
drbd_msg_put_info("minor exists as different volume");
|
||||||
return ERR_INVALID_REQUEST;
|
return ERR_INVALID_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue