summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-10-26 15:08:27 -0400
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:46 +0100
commit7c8ede16280586c72c36af6604985d714b84a32c (patch)
treeb45e440a23db431c8c2d55f03adeb13cce7d394b /fs
parentf2b39277b87dbb26f15e2e3b667df25dad3dd2ea (diff)
downloadlinux-7c8ede16280586c72c36af6604985d714b84a32c.tar.bz2
btrfs: move file-item prototypes into their own header
Move these prototypes out of ctree.h and into file-item.h. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/compression.c1
-rw-r--r--fs/btrfs/ctree.h31
-rw-r--r--fs/btrfs/defrag.c1
-rw-r--r--fs/btrfs/delayed-inode.c1
-rw-r--r--fs/btrfs/extent-tree.c1
-rw-r--r--fs/btrfs/extent_io.c1
-rw-r--r--fs/btrfs/file-item.c1
-rw-r--r--fs/btrfs/file-item.h35
-rw-r--r--fs/btrfs/file.c1
-rw-r--r--fs/btrfs/free-space-cache.c1
-rw-r--r--fs/btrfs/inode-item.c1
-rw-r--r--fs/btrfs/inode.c1
-rw-r--r--fs/btrfs/reflink.c1
-rw-r--r--fs/btrfs/relocation.c1
-rw-r--r--fs/btrfs/scrub.c1
-rw-r--r--fs/btrfs/send.c1
-rw-r--r--fs/btrfs/tree-log.c1
17 files changed, 50 insertions, 31 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index c0615af0434f..61828f8375e6 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -34,6 +34,7 @@
#include "extent_map.h"
#include "subpage.h"
#include "zoned.h"
+#include "file-item.h"
static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a9666dc95105..6bfea55c82a0 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -695,37 +695,6 @@ int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans,
int btrfs_del_orphan_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 offset);
-/* file-item.c */
-int btrfs_del_csums(struct btrfs_trans_handle *trans,
- struct btrfs_root *root, u64 bytenr, u64 len);
-blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u8 *dst);
-int btrfs_insert_hole_extent(struct btrfs_trans_handle *trans,
- struct btrfs_root *root, u64 objectid, u64 pos,
- u64 num_bytes);
-int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
- struct btrfs_path *path, u64 objectid,
- u64 bytenr, int mod);
-int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
- struct btrfs_ordered_sum *sums);
-blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio,
- u64 offset, bool one_ordered);
-int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
- struct list_head *list, int search_commit,
- bool nowait);
-void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,
- const struct btrfs_path *path,
- struct btrfs_file_extent_item *fi,
- const bool new_inline,
- struct extent_map *em);
-int btrfs_inode_clear_file_extent_range(struct btrfs_inode *inode, u64 start,
- u64 len);
-int btrfs_inode_set_file_extent_range(struct btrfs_inode *inode, u64 start,
- u64 len);
-void btrfs_inode_safe_disk_i_size_write(struct btrfs_inode *inode, u64 new_i_size);
-u64 btrfs_file_extent_end(const struct btrfs_path *path);
-
/* ioctl.c */
long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c
index 291263f93e47..ed82085acea3 100644
--- a/fs/btrfs/defrag.c
+++ b/fs/btrfs/defrag.c
@@ -14,6 +14,7 @@
#include "delalloc-space.h"
#include "subpage.h"
#include "defrag.h"
+#include "file-item.h"
static struct kmem_cache *btrfs_inode_defrag_cachep;
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index f93d2695e423..c024f97de9e0 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -18,6 +18,7 @@
#include "inode-item.h"
#include "space-info.h"
#include "accessors.h"
+#include "file-item.h"
#define BTRFS_DELAYED_WRITEBACK 512
#define BTRFS_DELAYED_BACKGROUND 128
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 510be00da406..940d4fe23cfb 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -40,6 +40,7 @@
#include "accessors.h"
#include "extent-tree.h"
#include "root-tree.h"
+#include "file-item.h"
#undef SCRAMBLE_DELAYED_REFS
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 545d9e1f0f83..ea31a326ae93 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -32,6 +32,7 @@
#include "compression.h"
#include "fs.h"
#include "accessors.h"
+#include "file-item.h"
static struct kmem_cache *extent_buffer_cache;
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 403a857d230e..20d88cd0b602 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -19,6 +19,7 @@
#include "compression.h"
#include "fs.h"
#include "accessors.h"
+#include "file-item.h"
#define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \
sizeof(struct btrfs_item) * 2) / \
diff --git a/fs/btrfs/file-item.h b/fs/btrfs/file-item.h
new file mode 100644
index 000000000000..51cd3ab5948c
--- /dev/null
+++ b/fs/btrfs/file-item.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef BTRFS_FILE_ITEM_H
+#define BTRFS_FILE_ITEM_H
+
+int btrfs_del_csums(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 bytenr, u64 len);
+blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u8 *dst);
+int btrfs_insert_hole_extent(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 objectid, u64 pos,
+ u64 num_bytes);
+int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ struct btrfs_path *path, u64 objectid,
+ u64 bytenr, int mod);
+int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ struct btrfs_ordered_sum *sums);
+blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio,
+ u64 offset, bool one_ordered);
+int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
+ struct list_head *list, int search_commit,
+ bool nowait);
+void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,
+ const struct btrfs_path *path,
+ struct btrfs_file_extent_item *fi,
+ const bool new_inline,
+ struct extent_map *em);
+int btrfs_inode_clear_file_extent_range(struct btrfs_inode *inode, u64 start,
+ u64 len);
+int btrfs_inode_set_file_extent_range(struct btrfs_inode *inode, u64 start, u64 len);
+void btrfs_inode_safe_disk_i_size_write(struct btrfs_inode *inode, u64 new_i_size);
+u64 btrfs_file_extent_end(const struct btrfs_path *path);
+
+#endif
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 8500472aa6ef..9c100198dd26 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -33,6 +33,7 @@
#include "fs.h"
#include "accessors.h"
#include "extent-tree.h"
+#include "file-item.h"
/* simple helper to fault in pages and copy. This should go away
* and be replaced with calls into generic code.
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 599b41523479..bc1b9aa164ec 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -27,6 +27,7 @@
#include "subpage.h"
#include "inode-item.h"
#include "accessors.h"
+#include "file-item.h"
#define BITS_PER_BITMAP (PAGE_SIZE * 8UL)
#define MAX_CACHE_BYTES_PER_GIG SZ_64K
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 724507ce7a7d..b65c45b5d681 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -13,6 +13,7 @@
#include "space-info.h"
#include "accessors.h"
#include "extent-tree.h"
+#include "file-item.h"
struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
int slot,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a3130e7c803d..7231f6b69096 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -61,6 +61,7 @@
#include "root-tree.h"
#include "defrag.h"
#include "dir-item.h"
+#include "file-item.h"
struct btrfs_iget_args {
u64 ino;
diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
index 9ba7914c7169..204bb884ab91 100644
--- a/fs/btrfs/reflink.c
+++ b/fs/btrfs/reflink.c
@@ -12,6 +12,7 @@
#include "transaction.h"
#include "subpage.h"
#include "accessors.h"
+#include "file-item.h"
#define BTRFS_MAX_DEDUPE_LEN SZ_16M
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index e345cc71da15..e86364bdac8e 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -32,6 +32,7 @@
#include "accessors.h"
#include "extent-tree.h"
#include "root-tree.h"
+#include "file-item.h"
/*
* Relocation overview
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 3aed760e1a80..e46e6c4d4bf9 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -23,6 +23,7 @@
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
+#include "file-item.h"
/*
* This is only the first step towards a full-features scrub. It reads all
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 0d3f25d4f147..4cc9e855a769 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -29,6 +29,7 @@
#include "print-tree.h"
#include "accessors.h"
#include "dir-item.h"
+#include "file-item.h"
/*
* Maximum number of references an extent can have in order for us to attempt to
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c168db7519e7..7be540fb5c4a 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -26,6 +26,7 @@
#include "extent-tree.h"
#include "root-tree.h"
#include "dir-item.h"
+#include "file-item.h"
#define MAX_CONFLICT_INODES 10