From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-scsi@vger.kernel.org,
Douglas Gilbert <dgilbert@interlog.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH 4/6] scsi_debug: add translation functions between LBA and index of provisioning map
Date: Thu, 02 May 2013 15:50:21 -0700 [thread overview]
Message-ID: <1367535021.3133.24.camel@dabdike> (raw)
In-Reply-To: <1366117920-11740-5-git-send-email-akinobu.mita@gmail.com>
On Tue, 2013-04-16 at 22:11 +0900, Akinobu Mita wrote:
> The translation from LBA to index of provisioning map (map_storep) is used
> in various places (map_state(), map_region(), and unmap_region()). But it
> is not correctly calculated if scsi_debug_unmap_alignment is zero.
>
> This introduces correct translation functions between LBA and index
> of provisioning map:
>
> static unsigned long lba_to_map_index(sector_t lba);
> static sector_t map_index_to_lba(unsigned long index);
>
> Actual bug fixes with using these functions will be done by forthcoming
> patches.
That's not the correct way to split patches, because it leads to untidy
things like this:
drivers/scsi/scsi_debug.c:2000:22: warning: ‘lba_to_map_index’ defined
but not used [-Wunused-function]
drivers/scsi/scsi_debug.c:2011:17: warning: ‘map_index_to_lba’ defined
but not used [-Wunused-function]
I fixed this just by rolling the last three patches together, but in
future, just put the static function in with whatever is calling it.
This is also good commit history practise regardless of the static
warning because it adds the function and the callers of that function in
the same commit meaning people who look later don't have to rummage
around for both commits.
James
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-05-02 22:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 13:11 [PATCH 0/6] scsi_debug: fix logical block provisioning support Akinobu Mita
2013-04-16 13:11 ` [PATCH 1/6] scsi_debug: call map_region() and unmap_region() only when needed Akinobu Mita
2013-04-25 1:59 ` Martin K. Petersen
2013-04-16 13:11 ` [PATCH 2/6] scsi_debug: prohibit scsi_debug_unmap_granularity == scsi_debug_unmap_alignment Akinobu Mita
2013-04-25 1:37 ` Martin K. Petersen
2013-04-16 13:11 ` [PATCH 3/6] scsi_debug: clear correct memory region when LBPRZ is enabled Akinobu Mita
2013-04-25 1:42 ` Martin K. Petersen
2013-04-16 13:11 ` [PATCH 4/6] scsi_debug: add translation functions between LBA and index of provisioning map Akinobu Mita
2013-04-25 1:43 ` Martin K. Petersen
2013-05-02 22:50 ` James Bottomley [this message]
2013-04-16 13:11 ` [PATCH 5/6] scsi_debug: fix initialization " Akinobu Mita
2013-04-25 1:44 ` Martin K. Petersen
2013-04-16 13:12 ` [PATCH 6/6] scsi_debug: fix logical block provisioning support Akinobu Mita
2013-04-25 1:46 ` Martin K. Petersen
2013-04-24 23:39 ` [PATCH 0/6] " Douglas Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367535021.3133.24.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=akinobu.mita@gmail.com \
--cc=dgilbert@interlog.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox