staging: lustre: ptlrpc: list_for_each improvements.
1/ use list_for_each_entry_safe() instead of
list_for_each_safe() and similar.
2/ use list_first_entry() and list_last_entry() where appropriate.
3/ When removing everything from a list, use
while ((x = list_first_entry_or_null()) {
as it makes the intent clear
4/ No need to take a spinlock in a structure that is about
to be freed - we must have exclusive access at this stage.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>