zoned.h (a94794d50d788d4735fd8f656ac8c0510117457d) zoned.h (169e0da91a21a571093feb8ff84c7e9229e64c08)
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef BTRFS_ZONED_H
4#define BTRFS_ZONED_H
5
6#include <linux/types.h>
7#include <linux/blkdev.h>
8#include "volumes.h"

--- 28 unchanged lines hidden (view full) ---

37void btrfs_advance_sb_log(struct btrfs_device *device, int mirror);
38int btrfs_reset_sb_log_zones(struct block_device *bdev, int mirror);
39u64 btrfs_find_allocatable_zones(struct btrfs_device *device, u64 hole_start,
40 u64 hole_end, u64 num_bytes);
41int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical,
42 u64 length, u64 *bytes);
43int btrfs_ensure_empty_zones(struct btrfs_device *device, u64 start, u64 size);
44int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new);
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef BTRFS_ZONED_H
4#define BTRFS_ZONED_H
5
6#include <linux/types.h>
7#include <linux/blkdev.h>
8#include "volumes.h"

--- 28 unchanged lines hidden (view full) ---

37void btrfs_advance_sb_log(struct btrfs_device *device, int mirror);
38int btrfs_reset_sb_log_zones(struct block_device *bdev, int mirror);
39u64 btrfs_find_allocatable_zones(struct btrfs_device *device, u64 hole_start,
40 u64 hole_end, u64 num_bytes);
41int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical,
42 u64 length, u64 *bytes);
43int btrfs_ensure_empty_zones(struct btrfs_device *device, u64 start, u64 size);
44int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new);
45void btrfs_calc_zone_unusable(struct btrfs_block_group *cache);
45#else /* CONFIG_BLK_DEV_ZONED */
46static inline int btrfs_get_dev_zone(struct btrfs_device *device, u64 pos,
47 struct blk_zone *zone)
48{
49 return 0;
50}
51
52static inline int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info)

--- 65 unchanged lines hidden (view full) ---

118}
119
120static inline int btrfs_load_block_group_zone_info(
121 struct btrfs_block_group *cache, bool new)
122{
123 return 0;
124}
125
46#else /* CONFIG_BLK_DEV_ZONED */
47static inline int btrfs_get_dev_zone(struct btrfs_device *device, u64 pos,
48 struct blk_zone *zone)
49{
50 return 0;
51}
52
53static inline int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info)

--- 65 unchanged lines hidden (view full) ---

119}
120
121static inline int btrfs_load_block_group_zone_info(
122 struct btrfs_block_group *cache, bool new)
123{
124 return 0;
125}
126
127static inline void btrfs_calc_zone_unusable(struct btrfs_block_group *cache) { }
128
126#endif
127
128static inline bool btrfs_dev_is_sequential(struct btrfs_device *device, u64 pos)
129{
130 struct btrfs_zoned_device_info *zone_info = device->zone_info;
131
132 if (!zone_info)
133 return false;

--- 69 unchanged lines hidden ---
129#endif
130
131static inline bool btrfs_dev_is_sequential(struct btrfs_device *device, u64 pos)
132{
133 struct btrfs_zoned_device_info *zone_info = device->zone_info;
134
135 if (!zone_info)
136 return false;

--- 69 unchanged lines hidden ---