Whamcloud - gitweb
LU-6142 lustre: convert use of container_of0 in include/ 80/38380/5
authorMr NeilBrown <neilb@suse.de>
Mon, 27 Apr 2020 04:54:13 +0000 (14:54 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 Jul 2020 03:02:25 +0000 (03:02 +0000)
commit200d4423787524eb8115b4fa4588a248065bd2be
tree5d7ffafac78adebed83bbce481bbb713f4ad2010
parentf762acebfcc6a88c3f4ba6296cbd6f1696bff530
LU-6142 lustre: convert use of container_of0 in include/

Most uses of container_of0() are changed to the upstream-standard
interface container_of_safe().  There is no clear context suggesting
that the pointer is known to be value, so it is consistent with the
current code to use the _safe() version.

In a few cases it is clear that the pointer must be valid.
This may be because:
 - it is a '.next' for a struct list_head
 - it from lo_object_next() whic his a special case of above
 - the returned value is confirmed to be valid by an LINVRNT()

So change all container_of0() to either container_of_safe() or
container_of().

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9fdb8b7216667e58d3837ea555889f9346e4b10a
Reviewed-on: https://review.whamcloud.com/38380
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/include/dt_object.h
lustre/include/lu_object.h
lustre/include/lustre_osc.h
lustre/include/md_object.h