adm_ctx 1435 drivers/block/drbd/drbd_int.h extern enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor); adm_ctx 2775 drivers/block/drbd/drbd_main.c enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor) adm_ctx 2777 drivers/block/drbd/drbd_main.c struct drbd_resource *resource = adm_ctx->resource; adm_ctx 2784 drivers/block/drbd/drbd_main.c int vnr = adm_ctx->volume; adm_ctx 159 drivers/block/drbd/drbd_nl.c static int drbd_adm_prepare(struct drbd_config_context *adm_ctx, adm_ctx 166 drivers/block/drbd/drbd_nl.c memset(adm_ctx, 0, sizeof(*adm_ctx)); adm_ctx 172 drivers/block/drbd/drbd_nl.c adm_ctx->reply_skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); adm_ctx 173 drivers/block/drbd/drbd_nl.c if (!adm_ctx->reply_skb) { adm_ctx 178 drivers/block/drbd/drbd_nl.c adm_ctx->reply_dh = genlmsg_put_reply(adm_ctx->reply_skb, adm_ctx 182 drivers/block/drbd/drbd_nl.c if (!adm_ctx->reply_dh) { adm_ctx 187 drivers/block/drbd/drbd_nl.c adm_ctx->reply_dh->minor = d_in->minor; adm_ctx 188 drivers/block/drbd/drbd_nl.c adm_ctx->reply_dh->ret_code = NO_ERROR; adm_ctx 190 drivers/block/drbd/drbd_nl.c adm_ctx->volume = VOLUME_UNSPECIFIED; adm_ctx 200 drivers/block/drbd/drbd_nl.c err = nla_put_nohdr(adm_ctx->reply_skb, adm_ctx 209 drivers/block/drbd/drbd_nl.c adm_ctx->volume = nla_get_u32(nla); adm_ctx 212 drivers/block/drbd/drbd_nl.c adm_ctx->resource_name = nla_data(nla); adm_ctx 213 drivers/block/drbd/drbd_nl.c adm_ctx->my_addr = nested_attr_tb[__nla_type(T_ctx_my_addr)]; adm_ctx 214 drivers/block/drbd/drbd_nl.c adm_ctx->peer_addr = nested_attr_tb[__nla_type(T_ctx_peer_addr)]; adm_ctx 215 drivers/block/drbd/drbd_nl.c if ((adm_ctx->my_addr && adm_ctx 216 drivers/block/drbd/drbd_nl.c nla_len(adm_ctx->my_addr) > sizeof(adm_ctx->connection->my_addr)) || adm_ctx 217 drivers/block/drbd/drbd_nl.c (adm_ctx->peer_addr && adm_ctx 218 drivers/block/drbd/drbd_nl.c nla_len(adm_ctx->peer_addr) > sizeof(adm_ctx->connection->peer_addr))) { adm_ctx 224 drivers/block/drbd/drbd_nl.c adm_ctx->minor = d_in->minor; adm_ctx 225 drivers/block/drbd/drbd_nl.c adm_ctx->device = minor_to_device(d_in->minor); adm_ctx 230 drivers/block/drbd/drbd_nl.c if (adm_ctx->device) adm_ctx 231 drivers/block/drbd/drbd_nl.c kref_get(&adm_ctx->device->kref); adm_ctx 233 drivers/block/drbd/drbd_nl.c if (adm_ctx->resource_name) { adm_ctx 234 drivers/block/drbd/drbd_nl.c adm_ctx->resource = drbd_find_resource(adm_ctx->resource_name); adm_ctx 237 drivers/block/drbd/drbd_nl.c if (!adm_ctx->device && (flags & DRBD_ADM_NEED_MINOR)) { adm_ctx 238 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "unknown minor"); adm_ctx 241 drivers/block/drbd/drbd_nl.c if (!adm_ctx->resource && (flags & DRBD_ADM_NEED_RESOURCE)) { adm_ctx 242 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "unknown resource"); adm_ctx 243 drivers/block/drbd/drbd_nl.c if (adm_ctx->resource_name) adm_ctx 249 drivers/block/drbd/drbd_nl.c if (adm_ctx->resource) { adm_ctx 250 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "no resource name expected"); adm_ctx 253 drivers/block/drbd/drbd_nl.c if (adm_ctx->device) { adm_ctx 254 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "no minor number expected"); adm_ctx 257 drivers/block/drbd/drbd_nl.c if (adm_ctx->my_addr && adm_ctx->peer_addr) adm_ctx 258 drivers/block/drbd/drbd_nl.c adm_ctx->connection = conn_get_by_addrs(nla_data(adm_ctx->my_addr), adm_ctx 259 drivers/block/drbd/drbd_nl.c nla_len(adm_ctx->my_addr), adm_ctx 260 drivers/block/drbd/drbd_nl.c nla_data(adm_ctx->peer_addr), adm_ctx 261 drivers/block/drbd/drbd_nl.c nla_len(adm_ctx->peer_addr)); adm_ctx 262 drivers/block/drbd/drbd_nl.c if (!adm_ctx->connection) { adm_ctx 263 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "unknown connection"); adm_ctx 269 drivers/block/drbd/drbd_nl.c if (adm_ctx->device && adm_ctx->resource && adm_ctx 270 drivers/block/drbd/drbd_nl.c adm_ctx->device->resource != adm_ctx->resource) { adm_ctx 272 drivers/block/drbd/drbd_nl.c adm_ctx->minor, adm_ctx->resource->name, adm_ctx 273 drivers/block/drbd/drbd_nl.c adm_ctx->device->resource->name); adm_ctx 274 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "minor exists in different resource"); adm_ctx 277 drivers/block/drbd/drbd_nl.c if (adm_ctx->device && adm_ctx 278 drivers/block/drbd/drbd_nl.c adm_ctx->volume != VOLUME_UNSPECIFIED && adm_ctx 279 drivers/block/drbd/drbd_nl.c adm_ctx->volume != adm_ctx->device->vnr) { adm_ctx 281 drivers/block/drbd/drbd_nl.c adm_ctx->minor, adm_ctx->volume, adm_ctx 282 drivers/block/drbd/drbd_nl.c adm_ctx->device->vnr, adm_ctx 283 drivers/block/drbd/drbd_nl.c adm_ctx->device->resource->name); adm_ctx 284 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "minor exists as different volume"); adm_ctx 289 drivers/block/drbd/drbd_nl.c if (!adm_ctx->resource) { adm_ctx 290 drivers/block/drbd/drbd_nl.c adm_ctx->resource = adm_ctx->device ? adm_ctx->device->resource adm_ctx 291 drivers/block/drbd/drbd_nl.c : adm_ctx->connection ? adm_ctx->connection->resource : NULL; adm_ctx 292 drivers/block/drbd/drbd_nl.c if (adm_ctx->resource) adm_ctx 293 drivers/block/drbd/drbd_nl.c kref_get(&adm_ctx->resource->kref); adm_ctx 299 drivers/block/drbd/drbd_nl.c nlmsg_free(adm_ctx->reply_skb); adm_ctx 300 drivers/block/drbd/drbd_nl.c adm_ctx->reply_skb = NULL; adm_ctx 304 drivers/block/drbd/drbd_nl.c static int drbd_adm_finish(struct drbd_config_context *adm_ctx, adm_ctx 307 drivers/block/drbd/drbd_nl.c if (adm_ctx->device) { adm_ctx 308 drivers/block/drbd/drbd_nl.c kref_put(&adm_ctx->device->kref, drbd_destroy_device); adm_ctx 309 drivers/block/drbd/drbd_nl.c adm_ctx->device = NULL; adm_ctx 311 drivers/block/drbd/drbd_nl.c if (adm_ctx->connection) { adm_ctx 312 drivers/block/drbd/drbd_nl.c kref_put(&adm_ctx->connection->kref, &drbd_destroy_connection); adm_ctx 313 drivers/block/drbd/drbd_nl.c adm_ctx->connection = NULL; adm_ctx 315 drivers/block/drbd/drbd_nl.c if (adm_ctx->resource) { adm_ctx 316 drivers/block/drbd/drbd_nl.c kref_put(&adm_ctx->resource->kref, drbd_destroy_resource); adm_ctx 317 drivers/block/drbd/drbd_nl.c adm_ctx->resource = NULL; adm_ctx 320 drivers/block/drbd/drbd_nl.c if (!adm_ctx->reply_skb) adm_ctx 323 drivers/block/drbd/drbd_nl.c adm_ctx->reply_dh->ret_code = retcode; adm_ctx 324 drivers/block/drbd/drbd_nl.c drbd_adm_send_reply(adm_ctx->reply_skb, info); adm_ctx 770 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 775 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 776 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 786 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 791 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 794 drivers/block/drbd/drbd_nl.c retcode = drbd_set_role(adm_ctx.device, R_PRIMARY, parms.assume_uptodate); adm_ctx 796 drivers/block/drbd/drbd_nl.c retcode = drbd_set_role(adm_ctx.device, R_SECONDARY, 0); adm_ctx 798 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 801 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 1574 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 1581 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 1582 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 1587 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 1588 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 1612 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 1638 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, adm_ctx 1702 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 1704 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 1792 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 1809 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 1810 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 1815 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 1816 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 1861 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2013 drivers/block/drbd/drbd_nl.c drbd_msg_sprintf_info(adm_ctx.reply_skb, adm_ctx 2187 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2188 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2206 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2208 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2230 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2235 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 2236 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2245 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2250 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2251 drivers/block/drbd/drbd_nl.c retcode = adm_detach(adm_ctx.device, parms.force_detach); adm_ctx 2252 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2254 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2428 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2437 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_CONNECTION); adm_ctx 2438 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2443 drivers/block/drbd/drbd_nl.c connection = adm_ctx.connection; adm_ctx 2444 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2459 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "net conf missing, try connect"); adm_ctx 2471 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2542 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2544 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2573 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2583 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_RESOURCE); adm_ctx 2585 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2589 drivers/block/drbd/drbd_nl.c if (!(adm_ctx.my_addr && adm_ctx.peer_addr)) { adm_ctx 2590 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "connection endpoint(s) missing"); adm_ctx 2600 drivers/block/drbd/drbd_nl.c if (nla_len(adm_ctx.my_addr) == connection->my_addr_len && adm_ctx 2601 drivers/block/drbd/drbd_nl.c !memcmp(nla_data(adm_ctx.my_addr), &connection->my_addr, adm_ctx 2607 drivers/block/drbd/drbd_nl.c if (nla_len(adm_ctx.peer_addr) == connection->peer_addr_len && adm_ctx 2608 drivers/block/drbd/drbd_nl.c !memcmp(nla_data(adm_ctx.peer_addr), &connection->peer_addr, adm_ctx 2616 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2617 drivers/block/drbd/drbd_nl.c connection = first_connection(adm_ctx.resource); adm_ctx 2637 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2653 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->conf_update); adm_ctx 2657 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->conf_update); adm_ctx 2668 drivers/block/drbd/drbd_nl.c connection->my_addr_len = nla_len(adm_ctx.my_addr); adm_ctx 2669 drivers/block/drbd/drbd_nl.c memcpy(&connection->my_addr, nla_data(adm_ctx.my_addr), connection->my_addr_len); adm_ctx 2670 drivers/block/drbd/drbd_nl.c connection->peer_addr_len = nla_len(adm_ctx.peer_addr); adm_ctx 2671 drivers/block/drbd/drbd_nl.c memcpy(&connection->peer_addr, nla_data(adm_ctx.peer_addr), connection->peer_addr_len); adm_ctx 2689 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->conf_update); adm_ctx 2702 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2703 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2711 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2713 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2785 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2792 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_CONNECTION); adm_ctx 2793 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2798 drivers/block/drbd/drbd_nl.c connection = adm_ctx.connection; adm_ctx 2804 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2809 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2815 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2817 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2839 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2850 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 2851 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2856 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2857 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 2870 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2963 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 2965 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 2976 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 2981 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_RESOURCE); adm_ctx 2982 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 2987 drivers/block/drbd/drbd_nl.c res_opts = adm_ctx.resource->res_opts; adm_ctx 2994 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 2998 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 2999 drivers/block/drbd/drbd_nl.c err = set_resource_options(adm_ctx.resource, &res_opts); adm_ctx 3005 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3008 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3014 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3018 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3019 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3024 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 3030 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3053 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3056 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3063 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3066 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3067 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3072 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3073 drivers/block/drbd/drbd_nl.c retcode = drbd_request_state(adm_ctx.device, mask, val); adm_ctx 3074 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3076 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3091 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3095 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3096 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3101 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 3107 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3133 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3136 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3142 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3145 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3146 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3151 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3152 drivers/block/drbd/drbd_nl.c if (drbd_request_state(adm_ctx.device, NS(user_isp, 1)) == SS_NOTHING_TO_DO) adm_ctx 3154 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3156 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3162 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3166 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3167 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3172 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3173 drivers/block/drbd/drbd_nl.c if (drbd_request_state(adm_ctx.device, NS(user_isp, 0)) == SS_NOTHING_TO_DO) { adm_ctx 3174 drivers/block/drbd/drbd_nl.c s = adm_ctx.device->state; adm_ctx 3182 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3184 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3195 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3199 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3200 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3205 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 3206 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 3243 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 3245 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 3905 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 3909 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 3910 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 3915 drivers/block/drbd/drbd_nl.c err = nla_put_status_info(adm_ctx.reply_skb, adm_ctx.device, NULL); adm_ctx 3917 drivers/block/drbd/drbd_nl.c nlmsg_free(adm_ctx.reply_skb); adm_ctx 3921 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4108 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4113 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 4114 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4120 drivers/block/drbd/drbd_nl.c adm_ctx.device->state.pdsk == D_OUTDATED ? UT_PEER_OUTDATED : adm_ctx 4121 drivers/block/drbd/drbd_nl.c test_bit(USE_DEGR_WFC_T, &adm_ctx.device->flags) ? UT_DEGRADED : adm_ctx 4124 drivers/block/drbd/drbd_nl.c err = timeout_parms_to_priv_skb(adm_ctx.reply_skb, &tp); adm_ctx 4126 drivers/block/drbd/drbd_nl.c nlmsg_free(adm_ctx.reply_skb); adm_ctx 4130 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4136 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4141 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 4142 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4147 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 4156 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 4160 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 4173 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 4175 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4182 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4189 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 4190 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4195 drivers/block/drbd/drbd_nl.c device = adm_ctx.device; adm_ctx 4201 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 4206 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 4251 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 4253 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4258 drivers/block/drbd/drbd_nl.c drbd_check_resource_name(struct drbd_config_context *adm_ctx) adm_ctx 4260 drivers/block/drbd/drbd_nl.c const char *name = adm_ctx->resource_name; adm_ctx 4262 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "resource name missing"); adm_ctx 4268 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx->reply_skb, "invalid resource name"); adm_ctx 4286 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4291 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, 0); adm_ctx 4292 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4301 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, from_attrs_err_to_txt(err)); adm_ctx 4305 drivers/block/drbd/drbd_nl.c retcode = drbd_check_resource_name(&adm_ctx); adm_ctx 4309 drivers/block/drbd/drbd_nl.c if (adm_ctx.resource) { adm_ctx 4312 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "resource exists"); adm_ctx 4320 drivers/block/drbd/drbd_nl.c connection = conn_create(adm_ctx.resource_name, &res_opts); adm_ctx 4335 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4348 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4352 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_RESOURCE); adm_ctx 4353 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4359 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "requested minor out of range"); adm_ctx 4363 drivers/block/drbd/drbd_nl.c if (adm_ctx.volume > DRBD_VOLUME_MAX) { adm_ctx 4364 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "requested volume id out of range"); adm_ctx 4371 drivers/block/drbd/drbd_nl.c if (adm_ctx.device) { adm_ctx 4378 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 4379 drivers/block/drbd/drbd_nl.c retcode = drbd_create_device(&adm_ctx, dh->minor); adm_ctx 4410 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 4412 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4455 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4458 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR); adm_ctx 4459 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4464 drivers/block/drbd/drbd_nl.c mutex_lock(&adm_ctx.resource->adm_mutex); adm_ctx 4465 drivers/block/drbd/drbd_nl.c retcode = adm_del_minor(adm_ctx.device); adm_ctx 4466 drivers/block/drbd/drbd_nl.c mutex_unlock(&adm_ctx.resource->adm_mutex); adm_ctx 4468 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4504 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4511 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_RESOURCE); adm_ctx 4512 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4517 drivers/block/drbd/drbd_nl.c resource = adm_ctx.resource; adm_ctx 4526 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "failed to demote"); adm_ctx 4533 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "failed to disconnect"); adm_ctx 4542 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "failed to detach"); adm_ctx 4552 drivers/block/drbd/drbd_nl.c drbd_msg_put_info(adm_ctx.reply_skb, "failed to delete volume"); adm_ctx 4561 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode); adm_ctx 4567 drivers/block/drbd/drbd_nl.c struct drbd_config_context adm_ctx; adm_ctx 4571 drivers/block/drbd/drbd_nl.c retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_RESOURCE); adm_ctx 4572 drivers/block/drbd/drbd_nl.c if (!adm_ctx.reply_skb) adm_ctx 4576 drivers/block/drbd/drbd_nl.c resource = adm_ctx.resource; adm_ctx 4582 drivers/block/drbd/drbd_nl.c drbd_adm_finish(&adm_ctx, info, retcode);