Re: [PATCH 3/8] scsi: clean up S/G table freeing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/07/14 18:31, Christoph Hellwig wrote:
-static void scsi_release_buffers(struct scsi_cmnd *cmd)
-{
-	if (cmd->sdb.table.nents)
-		scsi_free_sgtable(&cmd->sdb, false);
-
-	memset(&cmd->sdb, 0, sizeof(cmd->sdb));
-
-	if (scsi_prot_sg_count(cmd))
-		scsi_free_sgtable(cmd->prot_sdb, false);
-}
-
-static void scsi_release_bidi_buffers(struct scsi_cmnd *cmd)
-{
-	struct scsi_data_buffer *bidi_sdb = cmd->request->next_rq->special;
-
-	scsi_free_sgtable(bidi_sdb, false);
-	kmem_cache_free(scsi_sdb_cache, bidi_sdb);
-	cmd->request->next_rq->special = NULL;
-}

I can see that the scsi_free_sgtable(&cmd->sdb, false) call, the scsi_free_sgtable(cmd->prot_sdb, false) call and the scsi_free_sgtable(bidi_sdb, false) call are now performed by the new function scsi_free_sgtables(). But what's not clear to me is to which function the kmem_cache_free(scsi_sdb_cache, bidi_sdb) call has been moved ?

+		scsi_free_sgtables(cmd);
  		if (q->mq_ops) {
  			cmd->request->cmd_flags &= ~REQ_DONTPREP;
  			scsi_mq_uninit_cmd(cmd);
  			scsi_mq_requeue_cmd(cmd);
-		} else {
-			scsi_release_buffers(cmd);
+		} else
  			scsi_requeue_command(q, cmd);
-		}

Apparently braces have been removed from around the else-part. Isn't the preferred style to use braces around single-line else-clauses if the if-clause consists of multiple statements ?

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux