/* Note, scsi_block_requests() must be called while holding card->lock, otherwise it might foil sbp2_unblock()'s attempt to unblock the target.  */
static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
/* Note, scsi_block_requests() must be called while holding card->lock, otherwise it might foil sbp2_unblock()'s attempt to unblock the target.  */
static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
{
	struct sbp2_target *tgt = lu->tgt;
	struct fw_card *card = target_device(tgt)->card;
	struct Scsi_Host *shost =
		container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
	unsigned long flags;
	spin_lock_irqsave(&card->lock, flags);
	if (!tgt->dont_block && !lu->blocked &&
	    lu->generation != card->generation) {
		lu->blocked = true;
		if (++tgt->blocked == 1)
			scsi_block_requests(shost);
	}
	spin_unlock_irqrestore(&card->lock, flags);
}