@@ -74,7 +74,6 @@ int drbd_adm_dump_peer_devices_done(struct netlink_callback *cb);
7474int drbd_adm_get_initial_state (struct sk_buff * skb , struct netlink_callback * cb );
7575
7676#include <linux/drbd_genl_api.h>
77- #include "drbd_nla.h"
7877
7978static int drbd_pre_doit (const struct genl_split_ops * ops ,
8079 struct sk_buff * skb , struct genl_info * info );
@@ -239,14 +238,14 @@ static int drbd_adm_prepare(struct drbd_config_context *adm_ctx,
239238 goto fail ;
240239
241240 /* and assign stuff to the adm_ctx */
242- nla = nested_attr_tb [__nla_type ( T_ctx_volume ) ];
241+ nla = nested_attr_tb [T_ctx_volume ];
243242 if (nla )
244243 adm_ctx -> volume = nla_get_u32 (nla );
245- nla = nested_attr_tb [__nla_type ( T_ctx_resource_name ) ];
244+ nla = nested_attr_tb [T_ctx_resource_name ];
246245 if (nla )
247246 adm_ctx -> resource_name = nla_data (nla );
248- adm_ctx -> my_addr = nested_attr_tb [__nla_type ( T_ctx_my_addr ) ];
249- adm_ctx -> peer_addr = nested_attr_tb [__nla_type ( T_ctx_peer_addr ) ];
247+ adm_ctx -> my_addr = nested_attr_tb [T_ctx_my_addr ];
248+ adm_ctx -> peer_addr = nested_attr_tb [T_ctx_peer_addr ];
250249 if ((adm_ctx -> my_addr &&
251250 nla_len (adm_ctx -> my_addr ) > sizeof (adm_ctx -> connection -> my_addr )) ||
252251 (adm_ctx -> peer_addr &&
@@ -825,7 +824,6 @@ drbd_set_role(struct drbd_device *const device, enum drbd_role new_role, int for
825824static const char * from_attrs_err_to_txt (int err )
826825{
827826 return err == - ENOMSG ? "required attribute missing" :
828- err == - EOPNOTSUPP ? "unknown mandatory attribute" :
829827 err == - EEXIST ? "can not change invariant setting" :
830828 "invalid attribute value" ;
831829}
@@ -3303,14 +3301,13 @@ static int nla_put_drbd_cfg_context(struct sk_buff *skb,
33033301static struct nlattr * find_cfg_context_attr (const struct nlmsghdr * nlh , int attr )
33043302{
33053303 const unsigned hdrlen = GENL_HDRLEN + GENL_MAGIC_FAMILY_HDRSZ ;
3306- const int maxtype = ARRAY_SIZE (drbd_cfg_context_nl_policy ) - 1 ;
33073304 struct nlattr * nla ;
33083305
33093306 nla = nla_find (nlmsg_attrdata (nlh , hdrlen ), nlmsg_attrlen (nlh , hdrlen ),
33103307 DRBD_NLA_CFG_CONTEXT );
33113308 if (!nla )
33123309 return NULL ;
3313- return drbd_nla_find_nested ( maxtype , nla , __nla_type ( attr ) );
3310+ return nla_find_nested ( nla , attr );
33143311}
33153312
33163313static void resource_to_info (struct resource_info * , struct drbd_resource * );
@@ -4068,7 +4065,6 @@ int drbd_adm_get_status_all(struct sk_buff *skb, struct netlink_callback *cb)
40684065 struct nlattr * nla ;
40694066 const char * resource_name ;
40704067 struct drbd_resource * resource ;
4071- int maxtype ;
40724068
40734069 /* Is this a followup call? */
40744070 if (cb -> args [0 ]) {
@@ -4088,10 +4084,7 @@ int drbd_adm_get_status_all(struct sk_buff *skb, struct netlink_callback *cb)
40884084 /* No explicit context given. Dump all. */
40894085 if (!nla )
40904086 goto dump ;
4091- maxtype = ARRAY_SIZE (drbd_cfg_context_nl_policy ) - 1 ;
4092- nla = drbd_nla_find_nested (maxtype , nla , __nla_type (T_ctx_resource_name ));
4093- if (IS_ERR (nla ))
4094- return PTR_ERR (nla );
4087+ nla = nla_find_nested (nla , T_ctx_resource_name );
40954088 /* context given, but no name present? */
40964089 if (!nla )
40974090 return - EINVAL ;
0 commit comments