Commit 44e52cfa authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Rename DRBD_ADM_NEED_{CONN -> RESOURCE}

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 01b39b50
...@@ -141,7 +141,7 @@ int drbd_msg_put_info(const char *info) ...@@ -141,7 +141,7 @@ int drbd_msg_put_info(const char *info)
* If it returns successfully, adm_ctx members are valid. * If it returns successfully, adm_ctx members are valid.
*/ */
#define DRBD_ADM_NEED_MINOR 1 #define DRBD_ADM_NEED_MINOR 1
#define DRBD_ADM_NEED_CONN 2 #define DRBD_ADM_NEED_RESOURCE 2
static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info, static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
unsigned flags) unsigned flags)
{ {
...@@ -206,18 +206,18 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info, ...@@ -206,18 +206,18 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
drbd_msg_put_info("unknown minor"); drbd_msg_put_info("unknown minor");
return ERR_MINOR_INVALID; return ERR_MINOR_INVALID;
} }
if (!adm_ctx.tconn && (flags & DRBD_ADM_NEED_CONN)) { if (!adm_ctx.tconn && (flags & DRBD_ADM_NEED_RESOURCE)) {
drbd_msg_put_info("unknown connection"); drbd_msg_put_info("unknown resource");
return ERR_INVALID_REQUEST; return ERR_INVALID_REQUEST;
} }
/* some more paranoia, if the request was over-determined */ /* some more paranoia, if the request was over-determined */
if (adm_ctx.mdev && adm_ctx.tconn && if (adm_ctx.mdev && adm_ctx.tconn &&
adm_ctx.mdev->tconn != adm_ctx.tconn) { adm_ctx.mdev->tconn != adm_ctx.tconn) {
pr_warning("request: minor=%u, conn=%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,
adm_ctx.mdev->tconn->name); adm_ctx.mdev->tconn->name);
drbd_msg_put_info("minor exists in different connection"); drbd_msg_put_info("minor exists in different resource");
return ERR_INVALID_REQUEST; return ERR_INVALID_REQUEST;
} }
if (adm_ctx.mdev && if (adm_ctx.mdev &&
...@@ -1874,7 +1874,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) ...@@ -1874,7 +1874,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
int rsr; /* re-sync running */ int rsr; /* re-sync running */
struct crypto crypto = { }; struct crypto crypto = { };
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
...@@ -1993,7 +1993,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) ...@@ -1993,7 +1993,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
int i; int i;
int err; int err;
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
...@@ -2170,7 +2170,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info) ...@@ -2170,7 +2170,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info)
enum drbd_ret_code retcode; enum drbd_ret_code retcode;
int err; int err;
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
...@@ -2322,7 +2322,7 @@ int drbd_adm_resource_opts(struct sk_buff *skb, struct genl_info *info) ...@@ -2322,7 +2322,7 @@ int drbd_adm_resource_opts(struct sk_buff *skb, struct genl_info *info)
struct res_opts res_opts; struct res_opts res_opts;
int err; int err;
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
...@@ -3014,7 +3014,7 @@ int drbd_adm_add_minor(struct sk_buff *skb, struct genl_info *info) ...@@ -3014,7 +3014,7 @@ int drbd_adm_add_minor(struct sk_buff *skb, struct genl_info *info)
struct drbd_genlmsghdr *dh = info->userhdr; struct drbd_genlmsghdr *dh = info->userhdr;
enum drbd_ret_code retcode; enum drbd_ret_code retcode;
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
...@@ -3160,7 +3160,7 @@ int drbd_adm_del_resource(struct sk_buff *skb, struct genl_info *info) ...@@ -3160,7 +3160,7 @@ int drbd_adm_del_resource(struct sk_buff *skb, struct genl_info *info)
{ {
enum drbd_ret_code retcode; enum drbd_ret_code retcode;
retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN); retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_RESOURCE);
if (!adm_ctx.reply_skb) if (!adm_ctx.reply_skb)
return retcode; return retcode;
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
......
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