From patchwork Tue Oct 3 10:48:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9982237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E350602B8 for ; Tue, 3 Oct 2017 10:49:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4004F201CB for ; Tue, 3 Oct 2017 10:49:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3514023B23; Tue, 3 Oct 2017 10:49:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6596201CB for ; Tue, 3 Oct 2017 10:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751891AbdJCKtH (ORCPT ); Tue, 3 Oct 2017 06:49:07 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:41570 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbdJCKtF (ORCPT ); Tue, 3 Oct 2017 06:49:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+UZCgJ/iuwK/lJqXxRv36nLRf754WgYoh3o4Y7PPGcs=; b=tIPc8vfG5HVbRtDm3iLNXxqE5 igQvtw49uqX7MN3kAezThjKdGi2Azm83bXCW5Z/gAMqAt/fW/f7Rs1KxYGUEqOmBSPoEqUlfBxFUV +fb/DJAzRD8VlZsvsBRNKcj3UAeXA1SbK6Pxtf82JZi0Aku/wdfOaDi/XDWWuv0yCKa5N2ceYz2PL mM/8xOS40eawi/1TJaCkOhCEc+uBaOyoPqY/W/+GpwFuJe/3T/I5LyIFZiYEcYhwjoGgGxm+agLhJ jpJQCPpZHpKhmF+xc6dp8ziK5PqGcWSsZhKCH//294ZcoChWliGY3zLnOA574i8JnNlFkTbDFI1i0 0eyHtTvgA==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dzKl6-0003Gw-Tt; Tue, 03 Oct 2017 10:49:05 +0000 From: Christoph Hellwig To: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org Cc: Johannes Thumshirn , Benjamin Block Subject: [PATCH 6/9] bsg-lib: introduce a timeout field in struct bsg_job Date: Tue, 3 Oct 2017 12:48:42 +0200 Message-Id: <20171003104845.10417-7-hch@lst.de> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171003104845.10417-1-hch@lst.de> References: <20171003104845.10417-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The zfcp driver wants to know the timeout for a bsg job, so add a field to struct bsg_job for it in preparation of not exposing the request to the bsg-lib users. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Benjamin Block --- block/bsg-lib.c | 1 + drivers/s390/scsi/zfcp_fc.c | 4 ++-- include/linux/bsg-lib.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index 15d25ccd51a5..0d5bbf6a2ddd 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -132,6 +132,7 @@ static int bsg_prepare_job(struct device *dev, struct request *req) struct bsg_job *job = blk_mq_rq_to_pdu(req); int ret; + job->timeout = req->timeout; job->request = rq->cmd; job->request_len = rq->cmd_len; diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 8210645c2111..9d6f69b92c81 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -960,7 +960,7 @@ static int zfcp_fc_exec_els_job(struct bsg_job *job, d_id = ntoh24(bsg_request->rqst_data.h_els.port_id); els->handler = zfcp_fc_ct_els_job_handler; - return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ); + return zfcp_fsf_send_els(adapter, d_id, els, job->timeout / HZ); } static int zfcp_fc_exec_ct_job(struct bsg_job *job, @@ -979,7 +979,7 @@ static int zfcp_fc_exec_ct_job(struct bsg_job *job, return ret; ct->handler = zfcp_fc_ct_job_handler; - ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->req->timeout / HZ); + ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->timeout / HZ); if (ret) zfcp_fc_wka_port_put(wka_port); diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h index b1be0233ce35..402223c95ce1 100644 --- a/include/linux/bsg-lib.h +++ b/include/linux/bsg-lib.h @@ -44,6 +44,8 @@ struct bsg_job { struct kref kref; + unsigned int timeout; + /* Transport/driver specific request/reply structs */ void *request; void *reply;