diff options
author | Robin Dong <sanbai@taobao.com> | 2012-09-29 04:07:47 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-09 09:15:43 -0400 |
commit | 479ed9abdbeec5d9ed0005f3bee9c9bc06a102bb (patch) | |
tree | 11fccd8b9dccb61c64dd7901c03230671e5b0aac /fs/btrfs/extent_io.h | |
parent | 7a2d6a64645b38d7040bbd031c7a7b2655f5d976 (diff) |
btrfs: move inline function code to header file
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 <sanbai@taobao.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 7aeb31087f88..711d12b80028 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -282,8 +282,18 @@ void free_extent_buffer_stale(struct extent_buffer *eb); | |||
282 | int read_extent_buffer_pages(struct extent_io_tree *tree, | 282 | int read_extent_buffer_pages(struct extent_io_tree *tree, |
283 | struct extent_buffer *eb, u64 start, int wait, | 283 | struct extent_buffer *eb, u64 start, int wait, |
284 | get_extent_t *get_extent, int mirror_num); | 284 | get_extent_t *get_extent, int mirror_num); |
285 | unsigned long num_extent_pages(u64 start, u64 len); | 285 | |
286 | struct page *extent_buffer_page(struct extent_buffer *eb, unsigned long i); | 286 | static inline unsigned long num_extent_pages(u64 start, u64 len) |
287 | { | ||
288 | return ((start + len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - | ||
289 | (start >> PAGE_CACHE_SHIFT); | ||
290 | } | ||
291 | |||
292 | static inline struct page *extent_buffer_page(struct extent_buffer *eb, | ||
293 | unsigned long i) | ||
294 | { | ||
295 | return eb->pages[i]; | ||
296 | } | ||
287 | 297 | ||
288 | static inline void extent_buffer_get(struct extent_buffer *eb) | 298 | static inline void extent_buffer_get(struct extent_buffer *eb) |
289 | { | 299 | { |