On Oct 14, 2008, at 6:34 AM, FUJITA Tomonori wrote:
On Tue, 14 Oct 2008 04:44:17 -0700
Seokmann Ju <seokmann.ju@xxxxxxxxxx> wrote:
+static int
+fc_service_handler(struct Scsi_Host *shost, struct fc_rport
*rport,
+ struct request *req, struct request_queue *q)
+{
+ int ret;
+ struct request *rsp = req->next_rq;
+
+ if (!rsp) {
+ printk(KERN_ERR "ERROR: space for a FC service"
+ " response is missing\n");
+ return -EINVAL;
+ }
+
+ if ((req->bio->bi_vcnt > FC_SERVICE_MAX_SG) ||
+ (rsp->bio->bi_vcnt > FC_SERVICE_MAX_SG)) {
+ printk(KERN_ERR "ERROR: a FC service"
+ " supports no more than %d SGs\n", FC_SERVICE_MAX_SG);
+ return -EINVAL;
+ }
This doesn't look correct. bi_vcnt is not related with the number of
sg. You use scatter-gather for large data transfer. You don't need
to
worry about bi_vcnt.
I see...
Is there is a way to check, then, how many SG entries the service
needs before the blk_rq_map_sg()?
As I wrote in the previous mail, via blk_queue_max_hw_segments() and
blk_queue_max_phys_segments(), you can tell the block layer the number
of sg segments you can handle.
OK. I've got it. Thanks.
Seokmann
--
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