/*1* Copyright (C) 2008 Oracle. All rights reserved.2*3* This program is free software; you can redistribute it and/or4* modify it under the terms of the GNU General Public5* License v2 as published by the Free Software Foundation.6*7* This program is distributed in the hope that it will be useful,8* but WITHOUT ANY WARRANTY; without even the implied warranty of9* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU10* General Public License for more details.11*12* You should have received a copy of the GNU General Public13* License along with this program; if not, write to the14* Free Software Foundation, Inc., 59 Temple Place - Suite 330,15* Boston, MA 021110-1307, USA.16*/17#ifndef __REFCACHE__18#define __REFCACHE__1920struct btrfs_extent_info {21/* bytenr and num_bytes find the extent in the extent allocation tree */22u64 bytenr;23u64 num_bytes;2425/* objectid and offset find the back reference for the file */26u64 objectid;27u64 offset;28};2930struct btrfs_leaf_ref {31struct rb_node rb_node;32struct btrfs_leaf_ref_tree *tree;33int in_tree;34atomic_t usage;3536u64 root_gen;37u64 bytenr;38u64 owner;39u64 generation;40int nritems;4142struct list_head list;43struct btrfs_extent_info extents[];44};4546static inline size_t btrfs_leaf_ref_size(int nr_extents)47{48return sizeof(struct btrfs_leaf_ref) +49sizeof(struct btrfs_extent_info) * nr_extents;50}51#endif525354