From patchwork Wed Jul 29 01:15:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Disseldorp X-Patchwork-Id: 6888841 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E58DC9F39D for ; Wed, 29 Jul 2015 01:16:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D31520619 for ; Wed, 29 Jul 2015 01:16:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2563B20615 for ; Wed, 29 Jul 2015 01:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbbG2BQD (ORCPT ); Tue, 28 Jul 2015 21:16:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:35658 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbbG2BQA (ORCPT ); Tue, 28 Jul 2015 21:16:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 275F2AC40; Wed, 29 Jul 2015 01:15:59 +0000 (UTC) From: David Disseldorp To: mchristi@redhat.com Cc: ceph-devel@vger.kernel.org, David Disseldorp Subject: [RFC PATCH 3/5] rbd: export rbd_dev_[un]lock() Date: Wed, 29 Jul 2015 03:15:50 +0200 Message-Id: <1438132552-14673-4-git-send-email-ddiss@suse.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438132552-14673-1-git-send-email-ddiss@suse.de> References: <1438132552-14673-1-git-send-email-ddiss@suse.de> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To be used for COMPARE AND WRITE device locking. Signed-off-by: David Disseldorp --- drivers/block/rbd.h | 3 +++ drivers/block/rbd_main.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.h b/drivers/block/rbd.h index 60c6b85..1c6f947 100644 --- a/drivers/block/rbd.h +++ b/drivers/block/rbd.h @@ -24,6 +24,9 @@ extern int rbd_obj_notify_scsi_event_sync(struct rbd_device *rbd_dev, u32 event, extern int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, u64 notify_id); extern int rbd_attach_tcm_dev(struct rbd_device *rbd_dev, void *data); extern int rbd_detach_tcm_dev(struct rbd_device *rbd_dev); +extern int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type, + char *cookie, char *tag, char *desc, u8 flags); +extern int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie); #if defined(CONFIG_TCM_IBLOCK) || defined(CONFIG_TCM_IBLOCK_MODULE) diff --git a/drivers/block/rbd_main.c b/drivers/block/rbd_main.c index 57e76ed..cb90c08 100644 --- a/drivers/block/rbd_main.c +++ b/drivers/block/rbd_main.c @@ -4134,11 +4134,11 @@ int rbd_attach_tcm_dev(struct rbd_device *rbd_dev, void *data) * @type: lock type (RADOS_LOCK_EXCLUSIVE or RADOS_LOCK_SHARED) * @cookie: user-defined identifier for this instance of the lock * @tag: if RADOS_LOCK_SHARED, tag of the lock. NULL if non shared. - * desc: user-defined lock description + * @desc: user-defined lock description * @flags: lock flags */ -static int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type, - char *cookie, char *tag, char *desc, u8 flags) +int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type, + char *cookie, char *tag, char *desc, u8 flags) { int lock_op_buf_size; int name_len = strlen(name); @@ -4194,7 +4194,7 @@ static int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type, * @name: the name of the lock * @cookie: user-defined identifier for this instance of the lock */ -static int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie) +int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie) { int unlock_op_buf_size; int name_len = strlen(name);