Whamcloud - gitweb
LU-8066 lustre: drop ldebugfs_remove() 82/36682/7
authorMr NeilBrown <neilb@suse.de>
Tue, 5 Nov 2019 23:55:52 +0000 (10:55 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2019 05:58:59 +0000 (05:58 +0000)
commit2519bc95aabb31945d423ce95f5f840280c4adde
treeb21075c5b6992fd5c2a8a738e23408045325d793
parent1a7720934dfb3105afd2f025c953bea2167d4e5d
LU-8066 lustre: drop ldebugfs_remove()

ldebugfs_remove() is a wrapper around debugfs_remove_recursive()
which adds two features:
1/ the pointer is tested with IS_ERR_OR_NULL before making the call
2/ the pointer is cleared after the call.

The first is not needed since Linux 3.6
Commit a59d6293e537 ("debugfs: change parameter check in
                      debugfs_remove() functions")

and the "OR_NULL" part has never been needed.  In many cases a pointer
to a debugfs dentry is already never an error, or is NULLed as soon as
the error is noticed.  Only two place is an error stored (fid_request
and fld_request), so we change those to never store the error.

The second is only needed for a few global variables.  In most other
cases the structure holding the pointer will be freed in the near
future, so clearing the pointer is pointless.  obd_debugfs_entry is
one case where I wasn't certain the NULLing the pointer was not
needed.

Then the debugfs_remove_recursive() call is made just before module
exit, and the variable is local to the module, there is no point
clearing the variable.

As the extra functionality is barely needed, let's just use the
standard interface, with occasional checks and clears as needed.

Linux-commit b145d7865a7c ("staging: lustre: get rid of
                            ldebugfs_remove()")

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I68db147433273b70d6fe0957df10ed14e8e924bb
Reviewed-on: https://review.whamcloud.com/36682
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
19 files changed:
contrib/scripts/spelling.txt
lustre/fid/fid_handler.c
lustre/fid/fid_request.c
lustre/fld/fld_handler.c
lustre/fld/fld_request.c
lustre/include/lprocfs_status.h
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_resource.c
lustre/llite/lproc_llite.c
lustre/lod/lproc_lod.c
lustre/obdclass/lprocfs_status.c
lustre/osp/lproc_osp.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_delay.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/sec_lproc.c