btrfs-progs: libbtrfs: move extent-cache.h to ctree.h

Move the remaining structure definitions and prototypes to ctree.h that
is now the only user.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-06-03 17:24:38 +02:00
parent 6b539bbbc4
commit 355844f86b
4 changed files with 14 additions and 46 deletions

View File

@ -214,7 +214,7 @@ libbtrfs_objects = \
libbtrfs_headers = libbtrfs/send-stream.h libbtrfs/send-utils.h libbtrfs/send.h kernel-lib/rbtree.h \
kernel-lib/list.h kernel-lib/rbtree_types.h kerncompat.h \
libbtrfs/extent-cache.h ioctl.h libbtrfs/ctree.h version.h
ioctl.h libbtrfs/ctree.h version.h
libbtrfsutil_major := $(shell sed -rn 's/^\#define BTRFS_UTIL_VERSION_MAJOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
libbtrfsutil_minor := $(shell sed -rn 's/^\#define BTRFS_UTIL_VERSION_MINOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
libbtrfsutil_patch := $(shell sed -rn 's/^\#define BTRFS_UTIL_VERSION_PATCH ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)

View File

@ -23,13 +23,13 @@
#if BTRFS_FLAT_INCLUDES
#include "kernel-lib/list.h"
#include "kernel-lib/rbtree.h"
#include "kerncompat.h"
#include "libbtrfs/extent-cache.h"
#include "ioctl.h"
#else
#include <btrfs/list.h>
#include <btrfs/rbtree.h>
#include <btrfs/kerncompat.h>
#include <btrfs/extent-cache.h>
#include <btrfs/ioctl.h>
#endif /* BTRFS_FLAT_INCLUDES */
@ -210,6 +210,17 @@ struct btrfs_key {
u64 offset;
} __attribute__ ((__packed__));
struct cache_tree {
struct rb_root root;
};
struct cache_extent {
struct rb_node rb_node;
u64 objectid;
u64 start;
u64 size;
};
struct extent_io_tree {
struct cache_tree state;
struct cache_tree cache;

View File

@ -1,41 +0,0 @@
/*
* Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_EXTENT_CACHE_H__
#define __BTRFS_EXTENT_CACHE_H__
#if BTRFS_FLAT_INCLUDES
#include "kerncompat.h"
#include "kernel-lib/rbtree.h"
#else
#include <btrfs/kerncompat.h>
#include <btrfs/rbtree.h>
#endif /* BTRFS_FLAT_INCLUDES */
struct cache_tree {
struct rb_root root;
};
struct cache_extent {
struct rb_node rb_node;
u64 objectid;
u64 start;
u64 size;
};
#endif

View File

@ -23,7 +23,6 @@
#include "kernel-lib/list.h"
#include "kernel-shared/ctree.h"
#include "ioctl.h"
#include "common/extent-cache.h"
#include "kernel-shared/send.h"
#include "common/send-stream.h"
#include "common/send-utils.h"
@ -38,7 +37,6 @@
#include "btrfs/list.h"
#include "btrfs/ctree.h"
#include "btrfs/ioctl.h"
#include "btrfs/extent-cache.h"
#include "btrfs/send.h"
#include "btrfs/send-stream.h"
#include "btrfs/send-utils.h"