alistair23-linux/net/netfilter/ipvs
Johannes Berg 3b0f31f2b8 genetlink: make policy common to family
Since maxattr is common, the policy can't really differ sanely,
so make it common as well.

The only user that did in fact manage to make a non-common policy
is taskstats, which has to be really careful about it (since it's
still using a common maxattr!). This is no longer supported, but
we can fake it using pre_doit.

This reduces the size of e.g. nl80211.o (which has lots of commands):

   text	   data	    bss	    dec	    hex	filename
 398745	  14323	   2240	 415308	  6564c	net/wireless/nl80211.o (before)
 397913	  14331	   2240	 414484	  65314	net/wireless/nl80211.o (after)
--------------------------------
   -832      +8       0    -824

Which is obviously just 8 bytes for each command, and an added 8
bytes for the new policy pointer. I'm not sure why the ops list is
counted as .text though.

Most of the code transformations were done using the following spatch:
    @ops@
    identifier OPS;
    expression POLICY;
    @@
    struct genl_ops OPS[] = {
    ...,
     {
    -	.policy = POLICY,
     },
    ...
    };

    @@
    identifier ops.OPS;
    expression ops.POLICY;
    identifier fam;
    expression M;
    @@
    struct genl_family fam = {
            .ops = OPS,
            .maxattr = M,
    +       .policy = POLICY,
            ...
    };

This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
the cb->data as ops, which we want to change in a later genl patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-22 10:38:23 -04:00
..
ip_vs_app.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
ip_vs_conn.c ipvs: don't show negative times in ip_vs_conn 2018-08-16 19:36:57 +02:00
ip_vs_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-15 12:38:38 -08:00
ip_vs_ctl.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
ip_vs_dh.c
ip_vs_est.c
ip_vs_fo.c
ip_vs_ftp.c ipvs: change some data types from int to bool 2019-03-01 14:19:04 +01:00
ip_vs_lblc.c
ip_vs_lblcr.c
ip_vs_lc.c
ip_vs_mh.c treewide: convert ISO_8859-1 text comments to utf-8 2018-08-23 18:48:43 -07:00
ip_vs_nfct.c ipvs: add full ipv6 support to nfct 2018-06-01 14:01:54 +02:00
ip_vs_nq.c
ip_vs_ovf.c
ip_vs_pe.c
ip_vs_pe_sip.c
ip_vs_proto.c ipvs: add assured state for conn templates 2018-07-18 11:26:40 +02:00
ip_vs_proto_ah_esp.c ipvs: avoid indirect calls when calculating checksums 2019-01-28 11:15:58 +01:00
ip_vs_proto_sctp.c ipvs: get sctphdr by sctphoff in sctp_csum_check 2019-03-01 14:28:44 +01:00
ip_vs_proto_tcp.c ipvs: change some data types from int to bool 2019-03-01 14:19:04 +01:00
ip_vs_proto_udp.c ipvs: change some data types from int to bool 2019-03-01 14:19:04 +01:00
ip_vs_rr.c
ip_vs_sched.c
ip_vs_sed.c
ip_vs_sh.c
ip_vs_sync.c iov_iter: Separate type from direction and use accessor functions 2018-10-24 00:41:07 +01:00
ip_vs_wlc.c
ip_vs_wrr.c
ip_vs_xmit.c ipvs: change some data types from int to bool 2019-03-01 14:19:04 +01:00
Kconfig ipvs: fix dependency on nf_defrag_ipv6 2019-02-12 11:24:01 +01:00
Makefile