From patchwork Sat Sep 29 08:07:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dong X-Patchwork-Id: 1528191 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 29C5EE0010 for ; Sat, 29 Sep 2012 08:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758599Ab2I2IIr (ORCPT ); Sat, 29 Sep 2012 04:08:47 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:58222 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755259Ab2I2IH6 (ORCPT ); Sat, 29 Sep 2012 04:07:58 -0400 Received: by dady13 with SMTP id y13so899022dad.19 for ; Sat, 29 Sep 2012 01:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=xQaAgo8Lm3iW33F/SXAEeuU6+T7DR+Itn69zOAEEvsw=; b=U1boyIp2B0/v8j7AAmo8tdJBUlds69vYJnnFnEsPU5m8qT3wKZCXfrQqvFe/z8xFa8 SMW/T4gRlF98kRQC8O4uQjCkq1J330GAw7rJHL5guhaKogJ9b6h3Sdl4YOz1O71aZcYe yYQri7qMAbrX3ngqmJG1TbNBxOP+6MLUJkMv6UvitWj1AT5aFfadgtCnzRLdzQvQwM1b ejz8wWH8s2rT2GAxSZ+90xJX7sq06PSxMDg/Bz4C7kKDgHgBH5uW1GF+4Y8SRnmHX/9t xJ5pSCwR5nzFJnhfKJS/V+aZl5Yu07ia1EUQqTlg2QUYuqUzxlDtbg2QnQSDovBc3gUI j/0w== Received: by 10.68.222.40 with SMTP id qj8mr26094415pbc.139.1348906078073; Sat, 29 Sep 2012 01:07:58 -0700 (PDT) Received: from localhost.localdomain ([110.75.120.250]) by mx.google.com with ESMTPS id qd6sm6902801pbb.34.2012.09.29.01.07.56 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Sep 2012 01:07:57 -0700 (PDT) From: Robin Dong To: linux-btrfs@vger.kernel.org Cc: Robin Dong Subject: [PATCH 2/2] btrfs: move inline function code to header file Date: Sat, 29 Sep 2012 16:07:47 +0800 Message-Id: <1348906067-9348-2-git-send-email-robin.k.dong@gmail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1348906067-9348-1-git-send-email-robin.k.dong@gmail.com> References: <1348906067-9348-1-git-send-email-robin.k.dong@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Robin Dong When building btrfs from kernel code, it will report: fs/btrfs/extent_io.h:281: warning: 'extent_buffer_page' declared inline after being called fs/btrfs/extent_io.h:281: warning: previous declaration of 'extent_buffer_page' was here fs/btrfs/extent_io.h:280: warning: 'num_extent_pages' declared inline after being called fs/btrfs/extent_io.h:280: warning: previous declaration of 'num_extent_pages' was here because of the wrong declaration of inline functions. Signed-off-by: Robin Dong --- fs/btrfs/extent_io.c | 12 ------------ fs/btrfs/extent_io.h | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4c87847..82abd4e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3914,18 +3914,6 @@ out: return ret; } -inline struct page *extent_buffer_page(struct extent_buffer *eb, - unsigned long i) -{ - return eb->pages[i]; -} - -inline unsigned long num_extent_pages(u64 start, u64 len) -{ - return ((start + len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - - (start >> PAGE_CACHE_SHIFT); -} - static void __free_extent_buffer(struct extent_buffer *eb) { #if LEAK_DEBUG diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 25900af..0ebe4b5 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -277,8 +277,18 @@ void free_extent_buffer_stale(struct extent_buffer *eb); int read_extent_buffer_pages(struct extent_io_tree *tree, struct extent_buffer *eb, u64 start, int wait, get_extent_t *get_extent, int mirror_num); -unsigned long num_extent_pages(u64 start, u64 len); -struct page *extent_buffer_page(struct extent_buffer *eb, unsigned long i); + +static inline unsigned long num_extent_pages(u64 start, u64 len) +{ + return ((start + len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - + (start >> PAGE_CACHE_SHIFT); +} + +static inline struct page *extent_buffer_page(struct extent_buffer *eb, + unsigned long i) +{ + return eb->pages[i]; +} static inline void extent_buffer_get(struct extent_buffer *eb) {