Commit 42ff269d authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: add packet_type 27 (return_code_only) to netlink api

In case we ever should add an other packet type,
we must not reuse 27, as that currently used for
"empty" return code only replies.
Document it as such.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 3e3a7766
...@@ -2195,7 +2195,8 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms ...@@ -2195,7 +2195,8 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
goto fail; goto fail;
} }
if (nlp->packet_type >= P_nl_after_last_packet) { if (nlp->packet_type >= P_nl_after_last_packet ||
nlp->packet_type == P_return_code_only) {
retcode = ERR_PACKET_NR; retcode = ERR_PACKET_NR;
goto fail; goto fail;
} }
...@@ -2219,7 +2220,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms ...@@ -2219,7 +2220,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
reply = (struct drbd_nl_cfg_reply *) cn_reply->data; reply = (struct drbd_nl_cfg_reply *) cn_reply->data;
reply->packet_type = reply->packet_type =
cm->reply_body_size ? nlp->packet_type : P_nl_after_last_packet; cm->reply_body_size ? nlp->packet_type : P_return_code_only;
reply->minor = nlp->drbd_minor; reply->minor = nlp->drbd_minor;
reply->ret_code = NO_ERROR; /* Might by modified by cm->function. */ reply->ret_code = NO_ERROR; /* Might by modified by cm->function. */
/* reply->tag_list; might be modified by cm->function. */ /* reply->tag_list; might be modified by cm->function. */
...@@ -2525,6 +2526,7 @@ void drbd_nl_send_reply(struct cn_msg *req, int ret_code) ...@@ -2525,6 +2526,7 @@ void drbd_nl_send_reply(struct cn_msg *req, int ret_code)
cn_reply->len = sizeof(struct drbd_nl_cfg_reply); cn_reply->len = sizeof(struct drbd_nl_cfg_reply);
cn_reply->flags = 0; cn_reply->flags = 0;
reply->packet_type = P_return_code_only;
reply->minor = ((struct drbd_nl_cfg_req *)req->data)->drbd_minor; reply->minor = ((struct drbd_nl_cfg_req *)req->data)->drbd_minor;
reply->ret_code = ret_code; reply->ret_code = ret_code;
......
...@@ -146,9 +146,13 @@ NL_PACKET(new_c_uuid, 26, ...@@ -146,9 +146,13 @@ NL_PACKET(new_c_uuid, 26,
NL_BIT( 63, T_MANDATORY, clear_bm) NL_BIT( 63, T_MANDATORY, clear_bm)
) )
#ifdef NL_RESPONSE
NL_RESPONSE(return_code_only, 27)
#endif
#undef NL_PACKET #undef NL_PACKET
#undef NL_INTEGER #undef NL_INTEGER
#undef NL_INT64 #undef NL_INT64
#undef NL_BIT #undef NL_BIT
#undef NL_STRING #undef NL_STRING
#undef NL_RESPONSE
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/* declare packet_type enums */ /* declare packet_type enums */
enum packet_types { enum packet_types {
#define NL_PACKET(name, number, fields) P_ ## name = number, #define NL_PACKET(name, number, fields) P_ ## name = number,
#define NL_RESPONSE(name, number) P_ ## name = number,
#define NL_INTEGER(pn, pr, member) #define NL_INTEGER(pn, pr, member)
#define NL_INT64(pn, pr, member) #define NL_INT64(pn, pr, member)
#define NL_BIT(pn, pr, member) #define NL_BIT(pn, pr, member)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment