From patchwork Tue Apr 8 13:37:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kusanagi Kouichi X-Patchwork-Id: 3948961 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1EF9C9F369 for ; Tue, 8 Apr 2014 13:47:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 190B2203B8 for ; Tue, 8 Apr 2014 13:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC6DA203B7 for ; Tue, 8 Apr 2014 13:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756953AbaDHNrU (ORCPT ); Tue, 8 Apr 2014 09:47:20 -0400 Received: from mail-ae2-f132.auone-net.jp ([111.87.219.132]:51336 "EHLO dmta02.auone-net.jp" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756351AbaDHNrT (ORCPT ); Tue, 8 Apr 2014 09:47:19 -0400 X-Greylist: delayed 555 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Apr 2014 09:47:19 EDT Received: from amlmta031.auone-net.jp (amlmta031-MM [10.188.22.11]) by dmta02.auone-net.jp (au one net mail) with ESMTP id EC60040013E for ; Tue, 8 Apr 2014 22:37:39 +0900 (JST) Received: from ppp.dion.ne.jp ([222.14.169.24]) by amlmta031.auone-net.jp id 5343fba300097b1000000e9600001608fc000431297f; Tue, 08 Apr 2014 22:37:39 +0900 Date: Tue, 8 Apr 2014 22:37:39 +0900 From: Kusanagi Kouichi To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: Constify getters MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Message-Id: <5343fba300097b1000000e9600001608fc000431297f@amlmta031.auone-net.jp> X-MXM-DELIVERY-TYPE: 3 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Signed-off-by: Kusanagi Kouichi --- ctree.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ctree.h b/ctree.h index 9b461af..45f2faf 100644 --- a/ctree.h +++ b/ctree.h @@ -1184,9 +1184,9 @@ struct btrfs_root { sizeof(((type *)0)->member))) #define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits) \ -static inline u##bits btrfs_##name(struct extent_buffer *eb) \ +static inline u##bits btrfs_##name(const struct extent_buffer *eb) \ { \ - struct btrfs_header *h = (struct btrfs_header *)eb->data; \ + const struct btrfs_header *h = (struct btrfs_header *)eb->data; \ return le##bits##_to_cpu(h->member); \ } \ static inline void btrfs_set_##name(struct extent_buffer *eb, \ @@ -1197,11 +1197,11 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, \ } #define BTRFS_SETGET_FUNCS(name, type, member, bits) \ -static inline u##bits btrfs_##name(struct extent_buffer *eb, \ - type *s) \ +static inline u##bits btrfs_##name(const struct extent_buffer *eb, \ + const type *s) \ { \ unsigned long offset = (unsigned long)s; \ - type *p = (type *) (eb->data + offset); \ + const type *p = (type *) (eb->data + offset); \ return get_unaligned_le##bits(&p->member); \ } \ static inline void btrfs_set_##name(struct extent_buffer *eb, \ @@ -1213,7 +1213,7 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, \ } #define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits) \ -static inline u##bits btrfs_##name(type *s) \ +static inline u##bits btrfs_##name(const type *s) \ { \ return le##bits##_to_cpu(s->member); \ } \