aboutsummaryrefslogtreecommitdiff
path: root/include/linux/genl_magic_struct.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-05-04 16:06:51 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:55:45 +0100
commita5d8e1fb9d22851de89bbf52db6b11c56b895dd4 (patch)
treee01243c9f44464e60955896f4041241ec886d649 /include/linux/genl_magic_struct.h
parent813472ced7fac734157fe5be1137ce2bac942902 (diff)
downloadvexpress-lsk-a5d8e1fb9d22851de89bbf52db6b11c56b895dd4.tar.gz
drbd: Convert boolean flags on netlink from NLA_FLAG to NLA_U8
Flags of type NLA_FLAG are either present or absent, but do not have a value by themselves. Use type NLA_U8 for our boolean flags instead, and use the value to determine if the flag should be on or off. On the drbdsetup command line, all those flags have an optional yes/no argument which defaults to yes. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'include/linux/genl_magic_struct.h')
-rw-r--r--include/linux/genl_magic_struct.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/include/linux/genl_magic_struct.h b/include/linux/genl_magic_struct.h
index ddbdd0a2447..b1ddbb5bd72 100644
--- a/include/linux/genl_magic_struct.h
+++ b/include/linux/genl_magic_struct.h
@@ -86,8 +86,8 @@ enum {
/* possible field types */
#define __flg_field(attr_nr, attr_flag, name) \
- __field(attr_nr, attr_flag, name, NLA_FLAG, char, \
- nla_get_flag, __nla_put_flag)
+ __field(attr_nr, attr_flag, name, NLA_U8, char, \
+ nla_get_u8, NLA_PUT_U8)
#define __u8_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U8, unsigned char, \
nla_get_u8, NLA_PUT_U8)
@@ -118,12 +118,6 @@ enum {
#define __str_field_def(attr_nr, attr_flag, name, maxlen) \
__str_field(attr_nr, attr_flag, name, maxlen)
-#define __nla_put_flag(skb, attrtype, value) \
- do { \
- if (value) \
- NLA_PUT_FLAG(skb, attrtype); \
- } while (0)
-
#define GENL_op_init(args...) args
#define GENL_doit(handler) \
.doit = handler, \