Commit 7c8ede16 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: move file-item prototypes into their own header

Move these prototypes out of ctree.h and into file-item.h.
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f2b39277
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "extent_map.h" #include "extent_map.h"
#include "subpage.h" #include "subpage.h"
#include "zoned.h" #include "zoned.h"
#include "file-item.h"
static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" }; static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
......
...@@ -695,37 +695,6 @@ int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, ...@@ -695,37 +695,6 @@ int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans,
int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, int btrfs_del_orphan_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 offset); 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 */ /* ioctl.c */
long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 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); long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "delalloc-space.h" #include "delalloc-space.h"
#include "subpage.h" #include "subpage.h"
#include "defrag.h" #include "defrag.h"
#include "file-item.h"
static struct kmem_cache *btrfs_inode_defrag_cachep; static struct kmem_cache *btrfs_inode_defrag_cachep;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "inode-item.h" #include "inode-item.h"
#include "space-info.h" #include "space-info.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
#define BTRFS_DELAYED_WRITEBACK 512 #define BTRFS_DELAYED_WRITEBACK 512
#define BTRFS_DELAYED_BACKGROUND 128 #define BTRFS_DELAYED_BACKGROUND 128
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "accessors.h" #include "accessors.h"
#include "extent-tree.h" #include "extent-tree.h"
#include "root-tree.h" #include "root-tree.h"
#include "file-item.h"
#undef SCRAMBLE_DELAYED_REFS #undef SCRAMBLE_DELAYED_REFS
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "compression.h" #include "compression.h"
#include "fs.h" #include "fs.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
static struct kmem_cache *extent_buffer_cache; static struct kmem_cache *extent_buffer_cache;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "compression.h" #include "compression.h"
#include "fs.h" #include "fs.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
#define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \ #define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \
sizeof(struct btrfs_item) * 2) / \ sizeof(struct btrfs_item) * 2) / \
......
/* 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
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "fs.h" #include "fs.h"
#include "accessors.h" #include "accessors.h"
#include "extent-tree.h" #include "extent-tree.h"
#include "file-item.h"
/* simple helper to fault in pages and copy. This should go away /* simple helper to fault in pages and copy. This should go away
* and be replaced with calls into generic code. * and be replaced with calls into generic code.
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "subpage.h" #include "subpage.h"
#include "inode-item.h" #include "inode-item.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
#define BITS_PER_BITMAP (PAGE_SIZE * 8UL) #define BITS_PER_BITMAP (PAGE_SIZE * 8UL)
#define MAX_CACHE_BYTES_PER_GIG SZ_64K #define MAX_CACHE_BYTES_PER_GIG SZ_64K
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "space-info.h" #include "space-info.h"
#include "accessors.h" #include "accessors.h"
#include "extent-tree.h" #include "extent-tree.h"
#include "file-item.h"
struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf, struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
int slot, int slot,
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include "root-tree.h" #include "root-tree.h"
#include "defrag.h" #include "defrag.h"
#include "dir-item.h" #include "dir-item.h"
#include "file-item.h"
struct btrfs_iget_args { struct btrfs_iget_args {
u64 ino; u64 ino;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "transaction.h" #include "transaction.h"
#include "subpage.h" #include "subpage.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
#define BTRFS_MAX_DEDUPE_LEN SZ_16M #define BTRFS_MAX_DEDUPE_LEN SZ_16M
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "accessors.h" #include "accessors.h"
#include "extent-tree.h" #include "extent-tree.h"
#include "root-tree.h" #include "root-tree.h"
#include "file-item.h"
/* /*
* Relocation overview * Relocation overview
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "zoned.h" #include "zoned.h"
#include "fs.h" #include "fs.h"
#include "accessors.h" #include "accessors.h"
#include "file-item.h"
/* /*
* This is only the first step towards a full-features scrub. It reads all * This is only the first step towards a full-features scrub. It reads all
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "print-tree.h" #include "print-tree.h"
#include "accessors.h" #include "accessors.h"
#include "dir-item.h" #include "dir-item.h"
#include "file-item.h"
/* /*
* Maximum number of references an extent can have in order for us to attempt to * Maximum number of references an extent can have in order for us to attempt to
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "extent-tree.h" #include "extent-tree.h"
#include "root-tree.h" #include "root-tree.h"
#include "dir-item.h" #include "dir-item.h"
#include "file-item.h"
#define MAX_CONFLICT_INODES 10 #define MAX_CONFLICT_INODES 10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment