From patchwork Fri Jun 15 18:23:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Lingshan X-Patchwork-Id: 10467225 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 A018D60384 for ; Fri, 15 Jun 2018 18:24:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90DE828E3B for ; Fri, 15 Jun 2018 18:24:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8513128E42; Fri, 15 Jun 2018 18:24:19 +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.9 required=2.0 tests=BAYES_00, 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 2FB9828E3B for ; Fri, 15 Jun 2018 18:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756375AbeFOSYQ (ORCPT ); Fri, 15 Jun 2018 14:24:16 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:46743 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756311AbeFOSYP (ORCPT ); Fri, 15 Jun 2018 14:24:15 -0400 Received: from vstart.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Fri, 15 Jun 2018 12:24:06 -0600 From: Zhu Lingshan To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, nab@linux-iscsi.org, mchristi@redhat.com, martin.petersen@oracle.com Cc: hare@suse.de, lduncan@suse.com, ddiss@suse.de, lszhu@suse.de, Zhu Lingshan Subject: [PATCH 02/33] TCMU PR: add tcmu_dev_pr_info to store PR buffer Date: Sat, 16 Jun 2018 02:23:11 +0800 Message-Id: <20180615182342.6239-2-lszhu@suse.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615182342.6239-1-lszhu@suse.com> References: <20180615182342.6239-1-lszhu@suse.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch added a struct tcmu_dev_pr_info, which can help store the string buffer we got from a TCMU device record (for example, for RBD devices, the records should be stored in their metadata). So that we can decode / encode them. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 1dea66a851dd..1efc2800ca14 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -110,6 +110,14 @@ struct tcmu_nl_cmd { int status; }; +/* This struct help to store the string buffer which contain + * Persistent Reservation info record from the device metadata. + */ +struct tcmu_dev_pr_info { + struct mutex pr_info_lock; + char *pr_info_buf; + }; + struct tcmu_dev { struct list_head node; struct kref kref; @@ -165,6 +173,7 @@ struct tcmu_dev { char dev_config[TCMU_CONFIG_LEN]; int nl_reply_supported; + struct tcmu_dev_pr_info pr_info; }; #define TCMU_DEV(_se_dev) container_of(_se_dev, struct tcmu_dev, se_dev)