linux/net/smc
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
..
af_smc.c net/smc: add pnet table namespace support 2019-02-21 10:34:37 -08:00
Kconfig
Makefile net/smc: add base infrastructure for SMC-D and ISM 2018-06-30 20:42:25 +09:00
smc_cdc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-15 12:38:38 -08:00
smc_cdc.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-15 12:38:38 -08:00
smc_clc.c net/smc: fix another sizeof to int comparison 2019-02-01 14:45:44 -08:00
smc_clc.h net/smc: short wait for late smc_clc_wait_msg 2018-11-23 17:20:32 -08:00
smc_close.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
smc_close.h net/smc: replace sock_put worker by socket refcounting 2018-01-26 10:41:56 -05:00
smc_core.c net/smc: check connections in smc_lgr_free_work 2019-02-12 11:59:45 -05:00
smc_core.h net/smc: preallocated memory for rdma work requests 2019-02-04 09:11:19 -08:00
smc_diag.c net/smc: original socket family in inet_sock_diag 2019-02-07 18:06:19 -08:00
smc_ib.c net/smc: rework pnet table 2019-02-21 10:34:37 -08:00
smc_ib.h net/smc: rework pnet table 2019-02-21 10:34:37 -08:00
smc_ism.c net/smc: add SMC-D shutdown signal 2018-11-21 16:14:56 -08:00
smc_ism.h net/smc: add SMC-D shutdown signal 2018-11-21 16:14:56 -08:00
smc_llc.c net/smc: preallocated memory for rdma work requests 2019-02-04 09:11:19 -08:00
smc_llc.h net/smc: add infrastructure to send delete rkey messages 2018-11-23 17:20:32 -08:00
smc_netns.h net/smc: add pnet table namespace support 2019-02-21 10:34:37 -08:00
smc_pnet.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
smc_pnet.h net/smc: add pnet table namespace support 2019-02-21 10:34:37 -08:00
smc_rx.c pipe: stop using ->can_merge 2019-02-01 02:01:45 -05:00
smc_rx.h smc: add support for splice() 2018-05-04 11:45:06 -04:00
smc_tx.c net/smc: cleanup for smcr_tx_sndbuf_nonempty 2019-02-21 10:34:37 -08:00
smc_tx.h net/smc: eliminate cursor read and write calls 2018-07-23 10:57:14 -07:00
smc_wr.c net/smc: preallocated memory for rdma work requests 2019-02-04 09:11:19 -08:00
smc_wr.h net/smc: preallocated memory for rdma work requests 2019-02-04 09:11:19 -08:00
smc.h net/smc: fix smc_poll in SMC_INIT state 2019-02-21 10:19:20 -08:00