remarkable-linux/drivers/net
Tejun Heo 58292cbe66 sysfs: make attr namespace interface less convoluted
sysfs ns (namespace) implementation became more convoluted than
necessary while trying to hide ns information from visible interface.
The relatively recent attr ns support is a good example.

* attr ns tag is determined by sysfs_ops->namespace() callback while
  dir tag is determined by kobj_type->namespace().  The placement is
  arbitrary.

* Instead of performing operations with explicit ns tag, the namespace
  callback is routed through sysfs_attr_ns(), sysfs_ops->namespace(),
  class_attr_namespace(), class_attr->namespace().  It's not simpler
  in any sense.  The only thing this convolution does is traversing
  the whole stack backwards.

The namespace callbacks are unncessary because the operations involved
are inherently synchronous.  The information can be provided in in
straight-forward top-down direction and reversing that direction is
unnecessary and against basic design principles.

This backward interface is unnecessarily convoluted and hinders
properly separating out sysfs from driver model / kobject for proper
layering.  This patch updates attr ns support such that

* sysfs_ops->namespace() and class_attr->namespace() are dropped.

* sysfs_{create|remove}_file_ns(), which take explicit @ns param, are
  added and sysfs_{create|remove}_file() are now simple wrappers
  around the ns aware functions.

* ns handling is dropped from sysfs_chmod_file().  Nobody uses it at
  this point.  sysfs_chmod_file_ns() can be added later if necessary.

* Explicit @ns is propagated through class_{create|remove}_file_ns()
  and netdev_class_{create|remove}_file_ns().

* driver/net/bonding which is currently the only user of attr
  namespace is updated to use netdev_class_{create|remove}_file_ns()
  with @bh->net as the ns tag instead of using the namespace callback.

This patch should be an equivalent conversion without any functional
difference.  It makes the code easier to follow, reduces lines of code
a bit and helps proper separation and layering.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kay Sievers <kay@vrfy.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 14:50:01 -07:00
..
appletalk PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. 2013-07-15 11:25:01 +09:30
arcnet arcnet: cleanup sizeof parameter 2013-07-19 17:36:03 -07:00
bonding sysfs: make attr namespace interface less convoluted 2013-09-26 14:50:01 -07:00
caif caif: add a sanity check to the tty name 2013-09-04 00:27:27 -04:00
can can: mscan: improve clock API use 2013-08-29 22:49:35 +02:00
cris
dsa
ethernet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-09-19 13:57:28 -05:00
fddi drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
hamradio net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
hippi net/hippi/rrunner: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
hyperv Drivers: hv: remove HV_DRV_VERSION 2013-08-02 11:34:30 +08:00
ieee802154 drivers/net/ieee802154: don't use devm_pinctrl_get_select_default() in probe 2013-07-11 17:18:27 -07:00
irda net/irda/mcs7780: fix memory leaks in mcs_net_open() 2013-09-12 23:43:56 -04:00
phy drivers: net: phy: cicada.c: clears warning Use #include <linux/io.h> instead of <asm/io.h> 2013-09-17 19:07:00 -04:00
plip
ppp ip: generate unique IP identificator if local fragmentation is allowed 2013-09-19 14:11:15 -04:00
slip
team net: team: inherit addr_assign_type along with dev_addr 2013-09-03 20:57:49 -04:00
usb net: usb: cdc_ether: use usb.h macros whenever possible 2013-09-16 21:38:00 -04:00
vmxnet3 VMXNET3: Add support for virtual IOMMU 2013-08-27 16:02:02 -04:00
wan net: wan: sbni: Fix incorrect placement of __initdata 2013-08-09 13:24:26 -07:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-09-19 13:57:28 -05:00
xen-netback xen-netback: Don't destroy the netdev until the vif is shut down 2013-09-19 14:03:51 -04:00
dummy.c dummy: fix oops when loading the dummy failed 2013-07-11 11:59:20 -07:00
eql.c
ifb.c ifb: fix oops when loading the ifb failed 2013-07-11 12:00:05 -07:00
Kconfig packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
LICENSE.SRC
loopback.c net loopback: Set loopback_dev to NULL when freed 2013-09-17 19:05:13 -04:00
macvlan.c macvlan: Move skb_clone check closer to call 2013-09-11 16:03:12 -04:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-26 16:37:08 -04:00
Makefile packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
mdio.c
mii.c
netconsole.c netconsole: fix a deadlock with rtnl and netconsole's mutex 2013-09-19 14:15:53 -04:00
nlmon.c nlmon: use standard rtnetlink link api for add/del devices 2013-07-02 12:53:17 -07:00
ntb_netdev.c ntb_netdev: remove from list on exit 2013-05-15 10:58:14 -07:00
rionet.c rapidio/rionet: rework driver initialization and removal 2013-07-03 16:08:04 -07:00
sb1000.c
Space.c
sungem_phy.c
tun.c tuntap: correctly handle error in tun_set_iff() 2013-09-12 17:21:42 -04:00
veth.c veth: add vlan features 2013-07-19 17:36:03 -07:00
virtio_net.c virtio-net: Set RXCSUM feature if GUEST_CSUM is available 2013-09-03 21:36:41 -04:00
vxlan.c vxlan: Avoid creating fdb entry with NULL destination 2013-09-17 20:19:18 -04:00
xen-netfront.c xen-netfront: pull on receive skb may need to happen earlier 2013-07-17 12:51:19 -07:00