Skip to content
Snippets Groups Projects
Commit 473a4adc authored by Andreas Dilger's avatar Andreas Dilger Committed by Oleg Drokin
Browse files

LU-7787 mdd: clean up orphan object handling


There was a potential problem in the orphan object naming because
it had an embedded space in the filename before the "operation",
which might cause issues if they are accessed for other reasons.
It turns out that there is no need for the "operation" to be
embedded into the filename, since it was always ORPH_OP_UNLINK.

Use standard DFID formatting for the orphan object names, which
is a bit shorter and more efficient on disk, without the embedded
operation type.

Remove the use of "ORPH_OP_UNLINK" in the code, except in the
compatibility code for handling orphans left over after upgrades
from older Lustre versions.  This can be removed at some point
in the future when there are no longer upgrades from pre-2.11
versions.

Rename the orphan handling functions to start with mdd_orphan_*
for consistency with other MDD functions:
	orph_index_init -> mdd_orphan_index_init
	orph_index_iterate -> mdd_orphan_index_iterate
	orph_index_fini -> mdd_orphan_index_fini
	orph_declare_index_insert -> mdd_orphan_declare_insert
	orph_declare_index_insert -> mdd_orphan_declare_insert
	orph_key_test_and_del -> mdd_orphan_key_test_and_delete
	orph_key_fill -> mdd_orphan_key_fill
	orph_key_fill_18 -> mdd_orphan_key_fill_20
	__mdd_orphan_add -> mdd_orphan_insert
	__mdd_orphan_del -> mdd_orphan_delete
	__mdd_orphan_cleanup -> mdd_orphan_cleanup_thread

Remove single-line wrapper functions to clarify actual code:
	mdd_orphan_write_lock -> dt_write_lock
	mdd_orphan_write_unlock -> dt_write_unlock
	mdd_orphan_delete_obj -> dt_delete
	mdd_orphan_ref_add -> dt_ref_add
	mdd_orphan_ref_del -> dt_ref_del

Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Change-Id: Ica90cc03c3212103c39cba11c4566584bf9cab07
Reviewed-on: https://review.whamcloud.com/30547


Tested-by: Jenkins
Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
parent 860e20e4
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment