[stgt] [PATCH] fix bugs in persistent group reservations
Alexander Nezhinsky
nezhinsky at gmail.com
Sat Dec 22 22:47:26 CET 2012
> +static inline int list_is_last(const struct list_head *list,
> + const struct list_head *head)
> +{
> + return list->next == head;
> +}
Can't we just use list_add() instead of list_add_tail() in spc_pr_register():
list_add_tail(®->registration_siblings,
&cmd->dev->registration_list);
then we don't need to introduce list_is_last() and manage it with
list_first_entry() ?
> +static void __unregister_and_clean(struct scsi_cmd *cmd,
> + struct registration *reg)
> +{
. . .
> + if (!is_pr_type_all_registrants(holder->pr_type) ||
> + list_is_last(®->registration_siblings,
> + ®->registration_siblings)) {
Isn't it supposed to be:
> + list_is_last(®->registration_siblings,
> + &cmd->dev->registration_list)) {
?
Another thing, i'd suggest making a separate patch for
is_pr_type_all_registrants()
because it is a refactoring-like stuff and quite separate from other additions
and fixes.
Alexander
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list