From patchwork Wed Jan 23 19:10:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10777755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A1F46C2 for ; Wed, 23 Jan 2019 19:10:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CFBB2DAC1 for ; Wed, 23 Jan 2019 19:10:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B41F2DAC8; Wed, 23 Jan 2019 19:10:51 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 0AC562DAC1 for ; Wed, 23 Jan 2019 19:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726648AbfAWTKu (ORCPT ); Wed, 23 Jan 2019 14:10:50 -0500 Received: from out002.mailprotect.be ([83.217.72.86]:42655 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbfAWTKr (ORCPT ); Wed, 23 Jan 2019 14:10:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=S6v0RikNLVSH1Mdy7HmMBWrG3Q7N7Jr/xheS3I0F0kQ=; b=g5n8YAkFG98Y DVB9qvuYys3pLDFxYF7jDIiZu4hcPs+54qpbIDcBqeFhqFDTPAMAgJvDtJSuYdbmyRNKYuUfaPQeo mPISSbeDuDm1iyuYdYmHTNHa8RbmRyPqJu8y6FU6mV6iP6aHAgwqmCS+KnHCA8n045Wc4qssfNRW+ /a08K0TdDc2UJOiGCQSI+SJc1NPJKOxJbnXDz9I+76RUioRbAZxraKqkWGv3yJXZka3rK30ui4YL/ iJ495t06LtwPswgm9ULN5U/vKYZkRN7MT2NYBPoOa9LEuN+kcIAmD2NSJF+3LyuopDOxeHPgq5g+J 91Zqn9wIGH2xDja/PeNUPw==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gmNv1-00098M-ON; Wed, 23 Jan 2019 20:10:36 +0100 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id 4836CC04F4; Wed, 23 Jan 2019 20:10:31 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Douglas Gilbert , Hannes Reinecke , Christoph Hellwig Subject: [PATCH v2 5/7] Move several function definitions in Date: Wed, 23 Jan 2019 11:10:11 -0800 Message-Id: <20190123191013.119684-6-bvanassche@acm.org> X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog In-Reply-To: <20190123191013.119684-1-bvanassche@acm.org> References: <20190123191013.119684-1-bvanassche@acm.org> MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: SB/global_tokens (0.00271027283697) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5ufEH0XZNt19ZrI2yVHTLod602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTZnx3upumnqWBHj0/Vmi/pASQQA8gPlICyOXF4VQA3r681n IyHanrMzYl1QUFnGrJlGZdzQSLJYSD89hpteF8v30ykPg8qyrdUV98WGlbOjhJdwZpOImhB57vlA Ovnv7bRi5a8LLfqBhzJbqPiIMA+NOnrCrjOMG+XIApsj4flbNpUCGeLmhx53FRJAP1Ea5ASWYHcP 06zXqyXOojRJS4zkilCys0g8fRWcTXOmvCa0EATJsjWw5+0eZIpQIcK9yrRZBI4MtpSGpU9W4FdB tQesEelBF7Ngqas1fLSi+EsXiGRbN4cS9m3JKQpYnU+jEObu+ZQGpXspg4TOqv23+spbzJ3vJBBY vcIXZcvdbj7fjbZn+1a2iCCdPFy3WGiBkBZc+BBb+UeYFBhPAZQ65C2d4vB6Mmh6nzlzGKK4CNTd FmC4kGAnKNZdqPIYy5/0C0oKEgxQF7G4ajroXShVPl5s3ZvBSOdcZaQYlKee2Vxut+excQEBokpi mN+IpZsSCXc5abhTdeMRIGIFGG7eQynS17NirEYyqwqMBGrw8ELiqFSHA33y5Mb3HyPilJ6ZEZbN sFlW4xzv3KSabGJbxYTP9L1EoXi+CD9t4odUMDuXpq4Dt0gTEK9vOlOvpFXXjOyucj735mFcFqoc 4yysvQM8ASJFC/49WOPBr5nlEUI4xK39jKJ12NRmh/QKxJLghohhspljkOhpjzwdmRUuxUAkqPXL +0TQW2AlART5MskpktMqpQY/wTdSn/KmmRPQe1WngoWueOlSkfQrrNQ0YaVuKF0zwGgxiH5VYpT1 74cN8FvxDejqc1gSvA2YxCROcMK2BmRxGQKegzOmzXDxmXJaDPc+rUuIsEwVJ+BZMX32wjqOMN8v ravqDSvXmAO+8z0BwQwfsNJ3VhMvRBozUVixUV8ShebT8U8Xw9HTDfreWRYYPDOuh+QYnmwzDWDO +6sK1dZiHRd2NnuhNCjR/8or/5BQ64Vz3kPXuj5BYP5ioVC/LbdJldJ8xntHMcYfWXZf0dFZX9FP 4Sdv0y+AiR3/grHo9BntmBzD6tps2qyeMO7J//0XCxCMJn8bXo41UD2nJ33TKG1BQebqdAt2Cyon bEaUvgji2bemCFdq6WVPktdpl4o13pcoUjSBRABE8Sc= X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 Since the next patch will call scsi_out_cmd() from scsi_[gs]et_resid(), reorder the function definitions in . Cc: Douglas Gilbert Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Bart Van Assche --- include/scsi/scsi_cmnd.h | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 213404163993..673980ed7db6 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -185,61 +185,61 @@ static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; } static inline void scsi_dma_unmap(struct scsi_cmnd *cmd) { } #endif /* !CONFIG_SCSI_DMA */ -static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) +static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) { - return cmd->sdb.table.nents; + return blk_bidi_rq(cmd->request); } -static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd) +static inline struct scsi_cmnd *scsi_in_cmd(struct scsi_cmnd *cmd) { - return cmd->sdb.table.sgl; + if (likely(!scsi_bidi_cmnd(cmd))) + return cmd; + return blk_mq_rq_to_pdu(cmd->request->next_rq); } -static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd) +static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd) { - return cmd->sdb.length; + return &scsi_in_cmd(cmd)->sdb; } -static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) +static inline struct scsi_cmnd *scsi_out_cmd(struct scsi_cmnd *cmd) { - cmd->sdb.resid = resid; + return cmd; } -static inline int scsi_get_resid(struct scsi_cmnd *cmd) +static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) { - return cmd->sdb.resid; + return &scsi_out_cmd(cmd)->sdb; } -#define scsi_for_each_sg(cmd, sg, nseg, __i) \ - for_each_sg(scsi_sglist(cmd), sg, nseg, __i) - -static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) +static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) { - return blk_bidi_rq(cmd->request); + return cmd->sdb.table.nents; } -static inline struct scsi_cmnd *scsi_in_cmd(struct scsi_cmnd *cmd) +static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd) { - if (likely(!scsi_bidi_cmnd(cmd))) - return cmd; - return blk_mq_rq_to_pdu(cmd->request->next_rq); + return cmd->sdb.table.sgl; } -static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd) +static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd) { - return &scsi_in_cmd(cmd)->sdb; + return cmd->sdb.length; } -static inline struct scsi_cmnd *scsi_out_cmd(struct scsi_cmnd *cmd) +static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) { - return cmd; + cmd->sdb.resid = resid; } -static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) +static inline int scsi_get_resid(struct scsi_cmnd *cmd) { - return &scsi_out_cmd(cmd)->sdb; + return cmd->sdb.resid; } +#define scsi_for_each_sg(cmd, sg, nseg, __i) \ + for_each_sg(scsi_sglist(cmd), sg, nseg, __i) + static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd, void *buf, int buflen) {