From patchwork Thu Oct 20 00:49:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Willem Jan Withagen X-Patchwork-Id: 9385675 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 C61E4600CA for ; Thu, 20 Oct 2016 00:49:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B556028B21 for ; Thu, 20 Oct 2016 00:49:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A87FB28B4E; Thu, 20 Oct 2016 00:49:53 +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=-6.9 required=2.0 tests=BAYES_00,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 61FBA28B21 for ; Thu, 20 Oct 2016 00:49:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933500AbcJTAtu (ORCPT ); Wed, 19 Oct 2016 20:49:50 -0400 Received: from smtp.digiware.nl ([176.74.240.9]:48343 "EHLO smtp.digiware.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932707AbcJTAtt (ORCPT ); Wed, 19 Oct 2016 20:49:49 -0400 Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 07D1725D61; Thu, 20 Oct 2016 02:49:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5hsPc7djNYb; Thu, 20 Oct 2016 02:49:44 +0200 (CEST) Received: from [192.168.10.67] (opteron [192.168.10.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id E19E125D5D; Thu, 20 Oct 2016 02:49:44 +0200 (CEST) Subject: Re: Building for Clang is broken for snap-types To: kefu chai , Ceph Development References: <0e42917f-707d-a5a2-141a-6c5c971ff021@digiware.nl> From: Willem Jan Withagen Message-ID: <13220e29-4827-c2c9-5c88-0f4a88c2c244@digiware.nl> Date: Thu, 20 Oct 2016 02:49:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 20-10-2016 02:21, Willem Jan Withagen wrote: > On 19-10-2016 20:58, kefu chai wrote: >> should have been fixed in master. > > Ehh, > > Not really. > Just tested by running > cd Ceph/master/ceph > git pull > ./do_freebsd.sh > > And I still get the same error. > > Guess I'll have to start bisecting to see where it went wrong. This is the actual commit going wrong commit c9c5235ef7d563b92f44dab63a8ac2b694e69d4f Author: Sage Weil Date: Wed Sep 14 13:32:20 2016 -0400 include/object: conditional denc_traits for snapid_t Signed-off-by: Sage Weil if (s == CEPH_NOSNAP) return out << "head"; But have not figure out why. I'm going to give it some bedrest. > --WjW > > >> Willem Jan Withagen >于2016年10 >> 月20日 周四00:10写道: >> >> I guess somebody recently modified the type of either the ::encode() or >> snapid_t. But Clang now really throws a fit. >> >> --WjW >> >> /usr/srcs/Ceph/work/ceph/src/common/snap_types.h:58:5: error: no >> matching function for call to 'encode' >> ::encode(snaps, bl); >> ^~~~~~~~ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:68:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const __u8' (aka 'const unsigned char') for 1st argument >> WRITE_RAW_ENCODER(__u8) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:70:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const __s8' (aka 'const signed char') for 1st argument >> WRITE_RAW_ENCODER(__s8) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:72:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const char' for 1st argument >> WRITE_RAW_ENCODER(char) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:73:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const ceph_le64' for 1st argument >> WRITE_RAW_ENCODER(ceph_le64) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:74:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const ceph_le32' for 1st argument >> WRITE_RAW_ENCODER(ceph_le32) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:75:1: note: candidate >> function not viable: no known conversion from 'const vector' >> to 'const ceph_le16' for 1st argument >> WRITE_RAW_ENCODER(ceph_le16) >> ^ >> /usr/srcs/Ceph/work/ceph/src/include/encoding.h:65:15: note: expanded >> from macro 'WRITE_RAW_ENCODER' >> inline void encode(const type &v, bufferlist& bl, uint64_t features=0) >> { encode_raw(v, bl); } \ --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/include/object.h b/src/include/object.h index 74a011b..4532b78 100644 --- a/src/include/object.h +++ b/src/include/object.h @@ -122,6 +122,22 @@ struct snapid_t { inline void encode(snapid_t i, bufferlist &bl) { encode(i.val, bl); } inline void decode(snapid_t &i, bufferlist::iterator &p) { decode(i.val, p); } +template<> +struct denc_traits { + enum { supported = 2 }; + enum { featured = false }; + enum { bounded = true }; + static void bound_encode(const snapid_t o, size_t& p) { + denc(o.val, p); + } + static void encode(const snapid_t &o, buffer::list::contiguous_appender& p) { + denc(o.val, p); + } + static void decode(snapid_t& o, buffer::ptr::iterator &p) { + denc(o.val, p); + } +}; + inline ostream& operator<<(ostream& out, snapid_t s) {