Whamcloud - gitweb
LU-6142 lustre: convert some container_of0 to container_of 83/38383/3
authorMr NeilBrown <neilb@suse.de>
Mon, 27 Apr 2020 05:38:49 +0000 (15:38 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 May 2020 05:03:55 +0000 (05:03 +0000)
commit4b9f459af2c5325f625f49be79b314de86bab07f
tree843a9fd6cab42384fb9f820d6f90b7c4fcf25190
parente85e6cea15a77795cd4d46452463641fd2948a8d
LU-6142 lustre: convert some container_of0 to container_of

Each of these calls to container_of0() can be determined from local
context to be passed a valid pointer, so it is best to use
container_of() directly to make this clear.
Either:
 - the returned pointer is dereferenced with out be tests, or
 - the passed-in pointer is dereferened before the call, or
 - the passed-in pointer cannot be NULL, such as when
   it is a '.next' of a list_head or returned by lu_obecjt_next()

So convert all of these to container_of()

... except one which *should* be container_of(), but cannot
be as it won't compile cleanly on older kernels.  Change
that one to container_of_safe() with a big comment.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Idcd954f89ed366882563810ce042a5ddaba5a1e5
Reviewed-on: https://review.whamcloud.com/38383
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
17 files changed:
lustre/fid/fid_store.c
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/llite/llite_nfs.c
lustre/lod/lod_internal.h
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mgs/mgs_internal.h
lustre/mgs/mgs_llog.c
lustre/ofd/ofd_fs.c
lustre/ofd/ofd_internal.h
lustre/osp/osp_internal.h
lustre/osp/osp_sync.c
lustre/ptlrpc/nrs_tbf.c
lustre/target/tgt_lastrcvd.c
lustre/target/update_trans.c