Whamcloud - gitweb
LU-6142 osd-zfs: convert container_of0() to container_of() 79/38379/2
authorMr NeilBrown <neilb@suse.de>
Mon, 27 Apr 2020 04:53:12 +0000 (14:53 +1000)
committerOleg Drokin <green@whamcloud.com>
Thu, 14 May 2020 05:39:13 +0000 (05:39 +0000)
commitd9ceaf48c61cfbe1c600804d6f840b21bc000a83
tree75a7342bf76fdde59fbca0b84b5f9d9f5756e3ad
parent41356014f614ce7c3d235163cfab594e1b53b45d
LU-6142 osd-zfs: convert container_of0() to container_of()

Every use of container_of0() in osd-zfs can safely use container_of()
instead.  Doing so makes the intent of the code clearer.

In most cases, the pointer returned is later dereferenced without any
subsequent checks.  In a few cases (e.g.  in osd_internal.h), the
pointer passed in is dereferenced before the container_of() call.
These patterns assure us that the pointer in valid (not NULL or an
ERR_PTR), so container_of() is the correct interface to use.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I3f6d35c8b5beee09561e78c5eb20bb89d322590b
Reviewed-on: https://review.whamcloud.com/38379
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_io.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_xattr.c