From patchwork Thu May 21 07:16:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 6452951 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 BD8B79F399 for ; Thu, 21 May 2015 07:23:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3088203B4 for ; Thu, 21 May 2015 07:23:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8D9B2039E for ; Thu, 21 May 2015 07:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754921AbbEUHXl (ORCPT ); Thu, 21 May 2015 03:23:41 -0400 Received: from m199-177.yeah.net ([123.58.177.199]:45618 "EHLO m199-177.yeah.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754888AbbEUHXj (ORCPT ); Thu, 21 May 2015 03:23:39 -0400 X-Greylist: delayed 356 seconds by postgrey-1.27 at vger.kernel.org; Thu, 21 May 2015 03:23:38 EDT Received: from localhost.localdomain (unknown [113.240.220.93]) by m199-177.yeah.net (HMail) with ESMTPA id D28DD1104AAA; Thu, 21 May 2015 15:17:26 +0800 (CST) From: Li Wang To: Sage Weil Cc: ceph-devel@vger.kernel.org, Min Chen Subject: [PATCH] Rbd: support copy-on-read option Date: Thu, 21 May 2015 15:16:05 +0800 Message-Id: <1432192565-11811-1-git-send-email-liwang@ubuntukylin.com> X-Mailer: git-send-email 1.9.1 X-HM-Spam-Status: e1koWUFPN1dZCBgUCR5ZQUlMVU5PQkJCQklITEtNS05PTFdZCQ4XHghZQV koKz0kKDQ9Lz06MjckMjUkMz46Pz4pQUtVS0A2IyQiPigkMjUkMz46Pz4pQUtVS0ArLykkNTQkMj UkMz46Pz4pQUlVS0A4NC41LykiJDg1QUtVS0ApPjwyNDUkOigyOkFLVUtAKyk0LTI1OD4kMy41Oj VBS1VLQD8iNTo2MjgkMiskNTQkMjUkMz46Pz4pQUtVS0ApPjo3JDIrJDI1JCk5NyQyNSQzPjo*Pi lBSklVS0A2LjcvMiQpOCsvJD8yPT0#KT41LyQyNSQzPjo*PilBSVVLQDIrJE4kNjI1Li8#JDg1Ly RLJEpLQUtVS0AyKyRISyQ2MjUuLz4kODUvJEskTktBS1VLQDIrJEokMzQuKSQ4NS8kSyRKS0tBS1 VLQDIrJEokNjI1Li8#JDg1LyRLJEpLQUtVS0AyKyQvND86IiQ4NS8kSyRKS0tBS1VLQCguOTE#OC 8kTiQ2MjUuLz4kODUvJEskSktBS1VLQCguOTE#OC8kLzQ*OiIkODUvJEskSktLQUtVS0AoLjkxPj gvJEokMzQuKSQ4NS8kSyRKS0tBS1VLQDU0LyQ9OjY0LigkPzQ2OjI1JCgrPSQ9OjI3QUpLVUtAKC 45JD5BSlVOTlkG X-HM-Sender-Digest: e1kSHx4VD1lBWUc6MC46HSo5Kzo3CgEKPzMTDj5MNRUwCUpVSlVKT0hJ SkJJTU9MS0NIVTMWGhIXVRcSDBoVHDsOGQ4VDw4QAhcSFVUYFBZFWVdZDB4ZWUEdGhcIHldZCAFZ QUpNQ003V1kSC1lBWUpKSFVJT0tVSUlLVUJIWQY+ X-HM-Tid: 0a4d75557f236427d28dd1104aaa Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Min Chen Signed-off-by: Min Chen Reviewed-by: Li Wang --- doc/man/8/rbd.rst | 1 + src/rbd.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index 4552951..3fb747f 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -430,6 +430,7 @@ the running kernel. * ro - Map the image read-only. Equivalent to --read-only. +* ro - Map the image with copy-on-read turned on. Examples ======== diff --git a/src/rbd.cc b/src/rbd.cc index 4355c4f..fdc35ba 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -2545,6 +2545,8 @@ static int parse_map_options(char *options) return 1; } else if (!strcmp(this_char, "rw") || !strcmp(this_char, "ro")) { put_map_option("rw", this_char); + } else if (!strcmp(this_char, "cor")) { + put_map_option("cor", this_char); } else { cerr << "rbd: unknown map option '" << this_char << "'" << std::endl; return 1;