From patchwork Mon Sep 17 05:29:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Litz X-Patchwork-Id: 10602083 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 89622112B for ; Mon, 17 Sep 2018 05:30:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A19929585 for ; Mon, 17 Sep 2018 05:30:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CF452958D; Mon, 17 Sep 2018 05:30:00 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 1AB5B29585 for ; Mon, 17 Sep 2018 05:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727874AbeIQKzp (ORCPT ); Mon, 17 Sep 2018 06:55:45 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36602 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbeIQKzp (ORCPT ); Mon, 17 Sep 2018 06:55:45 -0400 Received: by mail-pg1-f193.google.com with SMTP id d1-v6so7096983pgo.3 for ; Sun, 16 Sep 2018 22:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Aci+kam7hng1Lfb4VLItJ/OAVhVqPKcNKxIFHEK4lNI=; b=ZP/kFytfj5FwcDOT+RCR4g2gGQtRwR+F3ueudZKbAIX+G9jeimGNyzGkpnxnZOXObZ RldfrCR3/dJAHJF4V+uk+hegxOT7UvNvMcdBLR83gkIKf7cCDVmrO1SgRvbVDOLxbSPt TTqeaA6Z5mNQb5IhgilISiF0wLK+x6xnrMtYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Aci+kam7hng1Lfb4VLItJ/OAVhVqPKcNKxIFHEK4lNI=; b=QGTOdiXZ/xObTRaaslVXwITdnGHQJeTzYYrEttVAdZGAmyR5zT5QE3NzbPgk7mfuK5 coVfKG7m60CEVtjdiIQ/d6kuuigZfblobanm1KEF98/S178DDfAKkKJWbjW89B9bH9bd jxebM69UtJDnGSMY6l5HH3/8KzjxVNUca+QggfdJg1auYeaL69NkVQ9dMmZKDdY40tsP MJDh1Y3cSyI5aA9QT2+cWU+n3nPxVu7k8YkCxImqY7Vkx/EMO9a0nT3TAaUEVEenV7I3 Aq2/BDNkXeeE1ADwvb1ZdO0nRLnJsBdDTwEWwEbU6l9ww80CjzL/MsFMEiitgH6JHTRK 1FSw== X-Gm-Message-State: APzg51BvD8yX/2oXG70hzk5S9FPxjOso/AdYdJQGLm0XywGpVsRth41I Z80lnJ7WmwR6ABFbhwPq8DaUrSLjzI9D6Q== X-Google-Smtp-Source: ANB0VdaMiUxd0YZLgVLvvS0RKB8FJFxp52mvUR/md7jetfiDpB3hgii46rEFugpehGQO3WjSUCeBkg== X-Received: by 2002:a62:da0b:: with SMTP id c11-v6mr24258128pfh.68.1537162198215; Sun, 16 Sep 2018 22:29:58 -0700 (PDT) Received: from bohr1.soe.ucsc.edu (bohr1.soe.ucsc.edu. [128.114.52.184]) by smtp.gmail.com with ESMTPSA id u11-v6sm22197795pfd.117.2018.09.16.22.29.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Sep 2018 22:29:57 -0700 (PDT) From: Heiner Litz To: linux-block@vger.kernel.org, hlitz@ucsc.edu Cc: javier@cnexlabs.com, mb@lightnvm.io, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com Subject: [RFC PATCH 4/6] lightnvm: pblk: Add pblk_submit_io_sem Date: Sun, 16 Sep 2018 22:29:37 -0700 Message-Id: <20180917052939.4776-5-hlitz@ucsc.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180917052939.4776-1-hlitz@ucsc.edu> References: <20180917052939.4776-1-hlitz@ucsc.edu> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation of supporting RAIL, add a new API pblk_submit_io_sem which takes the lun semaphore before submitting the asynchronous request. Signed-off-by: Heiner Litz --- drivers/lightnvm/pblk-core.c | 11 +++++++++++ drivers/lightnvm/pblk.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 2e40666fdf80..a31bf359f905 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -492,6 +492,17 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd) return nvm_submit_io(dev, rqd); } +int pblk_submit_io_sem(struct pblk *pblk, struct nvm_rq *rqd) +{ + struct ppa_addr *ppa_list = nvm_rq_to_ppa_list(rqd); + int ret; + + pblk_down_chunk(pblk, ppa_list[0]); + ret = pblk_submit_io(pblk, rqd); + + return ret; +} + void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd) { struct ppa_addr *ppa_list = nvm_rq_to_ppa_list(rqd); diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 64d9c206ec52..bd88784e51d9 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h @@ -797,6 +797,7 @@ struct nvm_chk_meta *pblk_chunk_get_off(struct pblk *pblk, void pblk_log_write_err(struct pblk *pblk, struct nvm_rq *rqd); void pblk_log_read_err(struct pblk *pblk, struct nvm_rq *rqd); int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd); +int pblk_submit_io_sem(struct pblk *pblk, struct nvm_rq *rqd); int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd); int pblk_submit_io_sync_sem(struct pblk *pblk, struct nvm_rq *rqd); int pblk_submit_meta_io(struct pblk *pblk, struct pblk_line *meta_line);