Skip to content

fiemap add a physical size #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 137 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
8bab0a3
btrfs: remove the pg_offset parameter from btrfs_get_extent()
adam900710 Jan 8, 2024
4d02b54
btrfs: remove unused variable bio_offset from end_bbio_data_read()
adam900710 Jan 8, 2024
84cda1a
btrfs: cache folio size and shift in extent_buffer
adam900710 Jan 5, 2024
592a0ce
btrfs: remove extent_map_tree forward declaration at extent_io.h
fdmanana Jan 9, 2024
8fd2b12
btrfs: WARN_ON_ONCE() in our leak detection code
josefbacik Jan 2, 2024
dfba9f4
btrfs: add set_folio_extent_mapped() helper
Dec 14, 2023
03fbf77
btrfs: convert defrag_prepare_one_page() to use a folio
Dec 14, 2023
fae9cd2
btrfs: use a folio array throughout the defrag process
Dec 14, 2023
df055af
btrfs: page to folio conversion in btrfs_truncate_block()
Jan 11, 2024
c4e5b74
btrfs: remove duplicate recording of physical address
morbidrsa Jan 17, 2024
4e00422
btrfs: replace sb::s_blocksize by fs_info::sectorsize
kdave Jan 16, 2024
dc52796
btrfs: replace i_blocksize by fs_info::sectorsize
kdave Jan 16, 2024
2b712e3
btrfs: remove unused included headers
kdave Jan 25, 2024
56596a9
btrfs: zstd: fix and simplify the inline extent decompression (v2)
adam900710 Jan 23, 2024
835cd82
btrfs: zlib: Fix spelling mistake "infalte" -> "inflate"
ColinIanKing Jan 22, 2024
c03c89f
btrfs: handle errors returned from unpin_extent_cache()
kdave Jan 12, 2024
44a6c34
btrfs: return errors from unpin_extent_range()
kdave Jan 12, 2024
91701bd
btrfs: make btrfs_error_unpin_extent_range() return void
kdave Jan 12, 2024
4d94501
btrfs: document what the spinlock unused_bgs_lock protects
fdmanana Jan 25, 2024
edebd19
btrfs: add comment about list_is_singular() use at btrfs_delete_unuse…
fdmanana Jan 25, 2024
e383e15
btrfs: preallocate temporary extent buffer for inode logging when needed
fdmanana Jan 26, 2024
4dc4a3b
btrfs: use READ/WRITE_ONCE for fs_devices->read_policy
naota Feb 2, 2024
1686570
btrfs: handle directory and dentry mismatch in btrfs_may_delete()
kdave Jan 19, 2024
c093bf3
btrfs: handle invalid range and start in merge_extent_mapping()
kdave Jan 19, 2024
97ec332
btrfs: handle block group lookup error when it's being removed
kdave Jan 20, 2024
0fe2983
btrfs: handle root deletion lookup error in btrfs_del_root()
kdave Jan 23, 2024
9dcb6ed
btrfs: handle invalid root reference found in btrfs_find_root()
kdave Jan 23, 2024
a672429
btrfs: handle invalid root reference found in btrfs_init_root_free_ob…
kdave Jan 23, 2024
7411055
btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks()
kdave Jan 23, 2024
a4259b6
btrfs: handle invalid extent item reference found in check_committed_…
kdave Jan 24, 2024
26b66d1
btrfs: export: handle invalid inode or root reference in btrfs_get_pa…
kdave Jan 19, 2024
778e618
btrfs: delayed-inode: drop pointless BUG_ON in __btrfs_remove_delayed…
kdave Jan 20, 2024
be73f44
btrfs: change BUG_ON to assertion when checking for delayed_node root
kdave Jan 20, 2024
51d4be5
btrfs: defrag: change BUG_ON to assertion in btrfs_defrag_leaves()
kdave Jan 19, 2024
2467d0f
btrfs: change BUG_ON to assertion in btrfs_read_roots()
kdave Jan 24, 2024
504a00a
btrfs: change BUG_ON to assertion when verifying lockdep class setup
kdave Jan 23, 2024
3e1d51d
btrfs: change BUG_ON to assertion when verifying root in btrfs_alloc_…
kdave Jan 24, 2024
53e4d8c
btrfs: change BUG_ON to assertion in reset_balance_state()
kdave Jan 24, 2024
5378ea6
btrfs: unify handling of return values of btrfs_insert_empty_items()
kdave Jan 24, 2024
0896ce7
btrfs: move transaction abort to the error site in btrfs_delete_free_…
kdave Jan 23, 2024
ca7f798
btrfs: move transaction abort to the error site in btrfs_create_free_…
kdave Jan 23, 2024
3c9da0d
btrfs: move transaction abort to the error site btrfs_rebuild_free_sp…
kdave Jan 23, 2024
737e6e5
btrfs: mark __btrfs_add_free_space static
Feb 6, 2024
b2136cc
btrfs: tests: allocate dummy fs_info and root in test_find_delalloc()
kdave Jan 29, 2024
c829389
btrfs: add helpers to get inode from page/folio pointers
kdave Sep 13, 2023
b33d2e5
btrfs: add helpers to get fs_info from page/folio pointers
kdave Sep 14, 2023
41044b4
btrfs: add helper to get fs_info from struct inode pointer
kdave Sep 14, 2023
e84bfff
btrfs: hoist fs_info out of loops in end_bbio_data_write and end_bbio…
kdave Jan 24, 2024
22b46bd
btrfs: add forward declarations and headers, part 1
kdave Jan 26, 2024
602035d
btrfs: add forward declarations and headers, part 2
kdave Jan 27, 2024
5693a12
btrfs: add forward declarations and headers, part 3
kdave Jan 27, 2024
8a46e55
btrfs: stop passing root argument to btrfs_add_delalloc_inodes()
fdmanana Feb 8, 2024
f5169f1
btrfs: stop passing root argument to __btrfs_del_delalloc_inode()
fdmanana Feb 8, 2024
f23f895
btrfs: assert root delalloc lock is held at __btrfs_del_delalloc_inode()
fdmanana Feb 8, 2024
f4f1545
btrfs: rename btrfs_add_delalloc_inodes() to singular form
fdmanana Feb 8, 2024
bdc0f89
btrfs: reduce inode lock critical section when setting and clearing d…
fdmanana Feb 9, 2024
b5d5639
btrfs: add lockdep assertion to remaining delalloc callbacks
fdmanana Feb 9, 2024
d23626d
btrfs: use assertion instead of BUG_ON when adding/removing to delall…
fdmanana Feb 9, 2024
99c15fe
btrfs: remove do_list variable at btrfs_set_delalloc_extent()
fdmanana Feb 9, 2024
4e94ee8
btrfs: remove do_list variable at btrfs_clear_delalloc_extent()
fdmanana Feb 9, 2024
dbe6cda
btrfs: push errors up from add_async_extent()
kdave Jan 24, 2024
5b95798
btrfs: update comment and drop assertion in extent item lookup in fin…
kdave Jan 24, 2024
11dcc86
btrfs: handle invalid extent item reference found in extent_from_logi…
kdave Jan 24, 2024
f626a0f
btrfs: handle invalid extent item reference found in find_first_exten…
kdave Jan 24, 2024
6fbc6f4
btrfs: handle invalid root reference found in may_destroy_subvol()
kdave Jan 24, 2024
e80e3f7
btrfs: send: handle unexpected data in header buffer in begin_cmd()
kdave Feb 6, 2024
5d22887
btrfs: send: handle unexpected inode in header process_recorded_refs()
kdave Feb 6, 2024
3c6ee34
btrfs: send: handle path ref underflow in header iterate_inode_ref()
kdave Feb 6, 2024
56f335e
btrfs: change BUG_ON to assertion in tree_move_down()
kdave Feb 6, 2024
4839c38
btrfs: change BUG_ONs to assertions in btrfs_qgroup_trace_subtree()
kdave Feb 6, 2024
f40a3ea
btrfs: delete pointless BUG_ON check on quota root in btrfs_qgroup_ac…
kdave Feb 6, 2024
bfe8a0c
btrfs: delete pointless BUG_ONs on extent item size
kdave Feb 6, 2024
636d91d
btrfs: delete BUG_ON in btrfs_init_locked_inode()
kdave Feb 7, 2024
f840ab7
btrfs: sysfs: drop unnecessary double logical negation in acl_show()
Conan-Kudo Feb 12, 2024
f33163e
btrfs: remove no longer used btrfs_transaction_in_commit()
fdmanana Feb 13, 2024
5ab2b18
btrfs: factor out validation of btrfs_ioctl_vol_args::name
kdave Feb 14, 2024
0478adf
btrfs: factor out validation of btrfs_ioctl_vol_args_v2::name
kdave Feb 14, 2024
0e9e135
btrfs: send: avoid duplicated search for last extent when sending hole
fdmanana Feb 17, 2024
74cd8ca
btrfs: avoid unnecessary ref initialization when freeing log tree block
fdmanana Feb 19, 2024
b2324e0
btrfs: raid56: extra debugging for raid6 syndrome generation
adam900710 Jan 26, 2024
2761ece
btrfs: introduce offload_csum_mode to tweak checksum offloading behavior
naota Feb 5, 2024
e605234
btrfs: move balance args conversion helpers to volumes.c
kdave Feb 16, 2024
56430c1
btrfs: open code btrfs_backref_iter_free()
kdave Feb 16, 2024
ef92344
btrfs: open code btrfs_backref_get_eb()
kdave Feb 16, 2024
2aa756e
btrfs: uninline some static inline helpers from backref.h
kdave Feb 16, 2024
585ab69
btrfs: uninline btrfs_init_delayed_root()
kdave Feb 16, 2024
2be1f2b
btrfs: drop static inline specifiers from tree-mod-log.c
kdave Feb 16, 2024
c207adc
btrfs: uninline some static inline helpers from tree-log.h
kdave Feb 16, 2024
e925671
btrfs: open code trivial btrfs_lru_cache_size()
kdave Feb 16, 2024
d57dd52
btrfs: uninline some static inline helpers from delayed-ref.h
kdave Feb 16, 2024
625c1e0
btrfs: use KMEM_CACHE() to create btrfs_delayed_node cache
KunWuChan Feb 20, 2024
4bd3e12
btrfs: use KMEM_CACHE() to create btrfs_ordered_extent cache
KunWuChan Feb 20, 2024
2753b4d
btrfs: use KMEM_CACHE() to create btrfs_trans_handle cache
KunWuChan Feb 20, 2024
66ce544
btrfs: use KMEM_CACHE() to create btrfs_path cache
KunWuChan Feb 20, 2024
b2c7d55
btrfs: use KMEM_CACHE() to create delayed ref caches
KunWuChan Feb 20, 2024
06c9564
btrfs: use KMEM_CACHE() to create btrfs_free_space cache
KunWuChan Feb 20, 2024
37bf771
btrfs: handle transaction commit errors in flush_reservations()
kdave Feb 22, 2024
1cdeac6
btrfs: pass btrfs_device to btrfs_scratch_superblocks()
kdave Feb 22, 2024
5a8a57f
btrfs: merge btrfs_del_delalloc_inode() helpers
kdave Feb 22, 2024
970ea37
btrfs: pass a valid extent map cache pointer to __get_extent_map()
kdave Feb 6, 2024
621b9ff
btrfs: unexport btrfs_subpage_start_writer() and btrfs_subpage_end_an…
adam900710 Feb 17, 2024
8e7e9c6
btrfs: subpage: make reader lock utilize bitmap
adam900710 Feb 17, 2024
b086c5b
btrfs: subpage: make writer lock utilize bitmap
adam900710 Feb 17, 2024
25da852
btrfs: compression: remove dead comments in btrfs_compress_heuristic()
adam900710 Feb 22, 2024
dd6a571
btrfs: tree-checker: dump the page status if hit something wrong
adam900710 Jan 26, 2024
d139ded
btrfs: qgroup: always free reserved space for extent records
adam900710 Feb 23, 2024
ef5a05c
btrfs: remove SLAB_MEM_SPREAD flag use
Feb 24, 2024
7ec28f8
btrfs: mark btrfs_put_caching_control() static
Feb 29, 2024
0782303
btrfs: include device major and minor numbers in the device scan notice
asj Feb 25, 2024
86211ee
btrfs: qgroup: validate btrfs_qgroup_inherit parameter
adam900710 Feb 27, 2024
b20fe56
btrfs: qgroup: allow quick inherit if snapshot is created and added t…
adam900710 Feb 26, 2024
ae6bd7f
btrfs: fix off-by-one chunk length calculation at contains_pending_ex…
fdmanana Feb 29, 2024
978b63f
btrfs: fix race when detecting delalloc ranges during fiemap
fdmanana Feb 28, 2024
1cab137
btrfs: reuse cloned extent buffer during fiemap to avoid re-allocations
fdmanana Feb 28, 2024
5a8b0a9
btrfs: === misc-next ===
kdave Feb 21, 2024
7e91f85
btrfs: prefer to allocate larger folio for metadata
adam900710 Jan 5, 2024
6423740
btrfs: page to folio conversion: prealloc_file_extent_cluster()
goldwynr Jan 23, 2024
80f19a5
btrfs: convert relocate_one_page() to relocate_one_folio()
goldwynr Jan 23, 2024
9e1e4d7
btrfs: page to folio conversion in put_file_data()
goldwynr Jan 23, 2024
c7a6ca4
btrfs: introduce cached folio size
adam900710 Jan 24, 2024
4a885ba
btrfs: defrag: prepare defrag for larger data folio size
adam900710 Jan 24, 2024
f5d376b
btrfs: compression: add error handling for missed page cache
adam900710 Jan 29, 2024
5130ea8
btrfs: compression: convert page allocation to folio interfaces
adam900710 Jan 29, 2024
ef3ae57
btrfs: make insert_inline_extent() to accept one page directly
adam900710 Jan 29, 2024
b7122bd
btrfs: migrate insert_inline_extent() to folio interfaces
adam900710 Jan 29, 2024
19fd2c8
btrfs: introduce btrfs_alloc_folio_array()
adam900710 Jan 29, 2024
985550b
btrfs: compression: migrate compression/decompression paths to folios
adam900710 Jan 29, 2024
71e3f3e
btrfs: report reclaim count in sysfs
boryas Feb 2, 2024
d4ce87f
btrfs: store fs_info on space_info
boryas Feb 2, 2024
a2e53e4
btrfs: dynamic block_group reclaim threshold
boryas Feb 2, 2024
94d3eb0
btrfs: periodic block_group reclaim
boryas Feb 2, 2024
9ef5923
btrfs: urgent periodic reclaim pass
boryas Feb 2, 2024
6aa332e
btrfs: prevent pathological periodic reclaim loops
boryas Feb 2, 2024
db77ce7
btrfs: handle unexpected parent block offset in btrfs_alloc_tree_block()
kdave Feb 7, 2024
39b492f
fs: add physical_length field to fiemap extents
sweettea Feb 29, 2024
1a9375b
fs: update fiemap_fill_next_extent() signature
sweettea Feb 29, 2024
d290a02
btrfs: return extent disk size in fiemap
sweettea Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions Documentation/filesystems/fiemap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,24 @@ Each extent is described by a single fiemap_extent structure as
returned in fm_extents::

struct fiemap_extent {
__u64 fe_logical; /* logical offset in bytes for the start of
* the extent */
__u64 fe_physical; /* physical offset in bytes for the start
* of the extent */
__u64 fe_length; /* length in bytes for the extent */
__u64 fe_reserved64[2];
__u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
__u32 fe_reserved[3];
/*
* logical offset in bytes for the start of
* the extent from the beginning of the file
*/
__u64 fe_logical;
/*
* physical offset in bytes for the start
* of the extent from the beginning of the disk
*/
__u64 fe_physical;
/* length in bytes for this extent */
__u64 fe_length;
/* physical length in bytes for this extent */
__u64 fe_physical_length;
__u64 fe_reserved64[1];
/* FIEMAP_EXTENT_* flags for this extent */
__u32 fe_flags;
__u32 fe_reserved[3];
};

All offsets and lengths are in bytes and mirror those on disk. It is valid
Expand Down Expand Up @@ -224,7 +234,8 @@ For each extent in the request range, the file system should call
the helper function, fiemap_fill_next_extent()::

int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
u64 phys, u64 len, u32 flags, u32 dev);
u64 phys, u64 log_len, u64 phys_len, u32 flags,
u32 dev);

fiemap_fill_next_extent() will use the passed values to populate the
next free extent in the fm_extents array. 'General' extent flags will
Expand Down
6 changes: 5 additions & 1 deletion fs/bcachefs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,9 @@ static int bch2_fill_extent(struct bch_fs *c,
ret = fiemap_fill_next_extent(info,
bkey_start_offset(k.k) << 9,
offset << 9,
k.k->size << 9, flags|flags2);
k.k->size << 9,
k.k->size << 9,
flags|flags2);
if (ret)
return ret;
}
Expand All @@ -869,12 +871,14 @@ static int bch2_fill_extent(struct bch_fs *c,
return fiemap_fill_next_extent(info,
bkey_start_offset(k.k) << 9,
0, k.k->size << 9,
k.k->size << 9,
flags|
FIEMAP_EXTENT_DATA_INLINE);
} else if (k.k->type == KEY_TYPE_reservation) {
return fiemap_fill_next_extent(info,
bkey_start_offset(k.k) << 9,
0, k.k->size << 9,
k.k->size << 9,
flags|
FIEMAP_EXTENT_DELALLOC|
FIEMAP_EXTENT_UNWRITTEN);
Expand Down
1 change: 1 addition & 0 deletions fs/btrfs/Kconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
# misc-next marker

config BTRFS_FS
tristate "Btrfs filesystem support"
Expand Down
15 changes: 8 additions & 7 deletions fs/btrfs/accessors.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#include <asm/unaligned.h>
#include "messages.h"
#include "ctree.h"
#include "extent_io.h"
#include "fs.h"
#include "accessors.h"

static bool check_setget_bounds(const struct extent_buffer *eb,
Expand Down Expand Up @@ -63,8 +64,8 @@ u##bits btrfs_get_token_##bits(struct btrfs_map_token *token, \
const unsigned long idx = get_eb_folio_index(token->eb, member_offset); \
const unsigned long oil = get_eb_offset_in_folio(token->eb, \
member_offset);\
const int unit_size = folio_size(token->eb->folios[0]); \
const int unit_shift = folio_shift(token->eb->folios[0]); \
const int unit_size = token->eb->folio_size; \
const int unit_shift = token->eb->folio_shift; \
const int size = sizeof(u##bits); \
u8 lebytes[sizeof(u##bits)]; \
const int part = unit_size - oil; \
Expand Down Expand Up @@ -94,7 +95,7 @@ u##bits btrfs_get_##bits(const struct extent_buffer *eb, \
const unsigned long idx = get_eb_folio_index(eb, member_offset);\
const unsigned long oil = get_eb_offset_in_folio(eb, \
member_offset);\
const int unit_size = folio_size(eb->folios[0]); \
const int unit_size = eb->folio_size; \
char *kaddr = folio_address(eb->folios[idx]); \
const int size = sizeof(u##bits); \
const int part = unit_size - oil; \
Expand All @@ -117,8 +118,8 @@ void btrfs_set_token_##bits(struct btrfs_map_token *token, \
const unsigned long idx = get_eb_folio_index(token->eb, member_offset); \
const unsigned long oil = get_eb_offset_in_folio(token->eb, \
member_offset);\
const int unit_size = folio_size(token->eb->folios[0]); \
const int unit_shift = folio_shift(token->eb->folios[0]); \
const int unit_size = token->eb->folio_size; \
const int unit_shift = token->eb->folio_shift; \
const int size = sizeof(u##bits); \
u8 lebytes[sizeof(u##bits)]; \
const int part = unit_size - oil; \
Expand Down Expand Up @@ -151,7 +152,7 @@ void btrfs_set_##bits(const struct extent_buffer *eb, void *ptr, \
const unsigned long idx = get_eb_folio_index(eb, member_offset);\
const unsigned long oil = get_eb_offset_in_folio(eb, \
member_offset);\
const int unit_size = folio_size(eb->folios[0]); \
const int unit_size = eb->folio_size; \
char *kaddr = folio_address(eb->folios[idx]); \
const int size = sizeof(u##bits); \
const int part = unit_size - oil; \
Expand Down
50 changes: 10 additions & 40 deletions fs/btrfs/accessors.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
#ifndef BTRFS_ACCESSORS_H
#define BTRFS_ACCESSORS_H

#include <linux/stddef.h>
#include <asm/unaligned.h>
#include <linux/stddef.h>
#include <linux/types.h>
#include <linux/align.h>
#include <linux/build_bug.h>
#include <linux/compiler.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <uapi/linux/btrfs_tree.h>

struct extent_buffer;

struct btrfs_map_token {
struct extent_buffer *eb;
Expand Down Expand Up @@ -844,45 +853,6 @@ static inline void btrfs_set_balance_sys(struct extent_buffer *eb,
write_eb_member(eb, bi, struct btrfs_balance_item, sys, ba);
}

static inline void btrfs_disk_balance_args_to_cpu(struct btrfs_balance_args *cpu,
const struct btrfs_disk_balance_args *disk)
{
memset(cpu, 0, sizeof(*cpu));

cpu->profiles = le64_to_cpu(disk->profiles);
cpu->usage = le64_to_cpu(disk->usage);
cpu->devid = le64_to_cpu(disk->devid);
cpu->pstart = le64_to_cpu(disk->pstart);
cpu->pend = le64_to_cpu(disk->pend);
cpu->vstart = le64_to_cpu(disk->vstart);
cpu->vend = le64_to_cpu(disk->vend);
cpu->target = le64_to_cpu(disk->target);
cpu->flags = le64_to_cpu(disk->flags);
cpu->limit = le64_to_cpu(disk->limit);
cpu->stripes_min = le32_to_cpu(disk->stripes_min);
cpu->stripes_max = le32_to_cpu(disk->stripes_max);
}

static inline void btrfs_cpu_balance_args_to_disk(
struct btrfs_disk_balance_args *disk,
const struct btrfs_balance_args *cpu)
{
memset(disk, 0, sizeof(*disk));

disk->profiles = cpu_to_le64(cpu->profiles);
disk->usage = cpu_to_le64(cpu->usage);
disk->devid = cpu_to_le64(cpu->devid);
disk->pstart = cpu_to_le64(cpu->pstart);
disk->pend = cpu_to_le64(cpu->pend);
disk->vstart = cpu_to_le64(cpu->vstart);
disk->vend = cpu_to_le64(cpu->vend);
disk->target = cpu_to_le64(cpu->target);
disk->flags = cpu_to_le64(cpu->flags);
disk->limit = cpu_to_le64(cpu->limit);
disk->stripes_min = cpu_to_le32(cpu->stripes_min);
disk->stripes_max = cpu_to_le32(cpu->stripes_max);
}

/* struct btrfs_super_block */
BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64);
BTRFS_SETGET_STACK_FUNCS(super_flags, struct btrfs_super_block, flags, 64);
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/sched/mm.h>
#include <linux/slab.h>
#include "ctree.h"
#include "btrfs_inode.h"
#include "xattr.h"
#include "acl.h"

Expand Down
11 changes: 11 additions & 0 deletions fs/btrfs/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
#ifndef BTRFS_ACL_H
#define BTRFS_ACL_H

struct posix_acl;
struct inode;
struct btrfs_trans_handle;

#ifdef CONFIG_BTRFS_FS_POSIX_ACL

struct mnt_idmap;
struct dentry;

struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu);
int btrfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
Expand All @@ -13,6 +20,10 @@ int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,

#else

#include <linux/errno.h>

struct btrfs_trans_handle;

#define btrfs_get_acl NULL
#define btrfs_set_acl NULL
static inline int __btrfs_set_acl(struct btrfs_trans_handle *trans,
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <linux/freezer.h>
#include <trace/events/btrfs.h>
#include "async-thread.h"
#include "ctree.h"

enum {
WORK_DONE_BIT,
Expand Down
3 changes: 3 additions & 0 deletions fs/btrfs/async-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
#ifndef BTRFS_ASYNC_THREAD_H
#define BTRFS_ASYNC_THREAD_H

#include <linux/compiler_types.h>
#include <linux/workqueue.h>
#include <linux/list.h>

struct btrfs_fs_info;
struct btrfs_workqueue;
struct btrfs_work;

typedef void (*btrfs_func_t)(struct btrfs_work *arg);
typedef void (*btrfs_ordered_func_t)(struct btrfs_work *arg, bool);

Expand Down
Loading