locking/atomic, kref: Add kref_read()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 14 Nov 2016 16:29:48 +0000 (17:29 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 14 Jan 2017 10:37:18 +0000 (11:37 +0100)
commit2c935bc57221cc2edc787c72ea0e2d30cdcd3d5e
tree4ccb975ac9142887b4e7e7bf1c0cca5c53d4cf99
parent1e24edca0557dba6486d39d3c24c288475432bcf
locking/atomic, kref: Add kref_read()

Since we need to change the implementation, stop exposing internals.

Provide kref_read() to read the current reference count; typically
used for debug messages.

Kills two anti-patterns:

atomic_read(&kref->refcount)
kref->refcount.counter

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
56 files changed:
drivers/block/drbd/drbd_req.c
drivers/block/rbd.c
drivers/block/virtio_blk.c
drivers/gpu/drm/drm_gem_cma_helper.c
drivers/gpu/drm/drm_info.c
drivers/gpu/drm/drm_mode_object.c
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/i915/i915_gem_object.h
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_object.c
drivers/infiniband/hw/cxgb3/iwch_cm.h
drivers/infiniband/hw/cxgb3/iwch_qp.c
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
drivers/infiniband/hw/cxgb4/qp.c
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
drivers/infiniband/hw/usnic/usnic_ib_verbs.c
drivers/misc/genwqe/card_dev.c
drivers/misc/mei/debugfs.c
drivers/pci/hotplug/pnv_php.c
drivers/pci/slot.c
drivers/scsi/bnx2fc/bnx2fc_io.c
drivers/scsi/cxgbi/libcxgbi.h
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/staging/android/ion/ion.c
drivers/staging/comedi/comedi_buf.c
drivers/target/target_core_pr.c
drivers/target/tcm_fc/tfc_sess.c
drivers/usb/gadget/function/f_fs.c
fs/exofs/sys.c
fs/ocfs2/cluster/netdebug.c
fs/ocfs2/cluster/tcp.c
fs/ocfs2/dlm/dlmdebug.c
fs/ocfs2/dlm/dlmdomain.c
fs/ocfs2/dlm/dlmmaster.c
fs/ocfs2/dlm/dlmunlock.c
include/drm/drm_framebuffer.h
include/drm/ttm/ttm_bo_driver.h
include/linux/kref.h
include/linux/sunrpc/cache.h
include/net/bluetooth/hci_core.h
net/bluetooth/6lowpan.c
net/bluetooth/a2mp.c
net/bluetooth/amp.c
net/bluetooth/l2cap_core.c
net/ceph/messenger.c
net/ceph/osd_client.c
net/sunrpc/cache.c
net/sunrpc/svc_xprt.c
net/sunrpc/xprtrdma/svc_rdma_transport.c