Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/fs/btrfs/discard.h
26278 views
1
/* SPDX-License-Identifier: GPL-2.0 */
2
3
#ifndef BTRFS_DISCARD_H
4
#define BTRFS_DISCARD_H
5
6
#include <linux/types.h>
7
#include <linux/sizes.h>
8
9
struct btrfs_fs_info;
10
struct btrfs_discard_ctl;
11
struct btrfs_block_group;
12
13
/* Discard size limits */
14
#define BTRFS_ASYNC_DISCARD_DEFAULT_MAX_SIZE (SZ_64M)
15
#define BTRFS_ASYNC_DISCARD_MAX_FILTER (SZ_1M)
16
#define BTRFS_ASYNC_DISCARD_MIN_FILTER (SZ_32K)
17
18
/* List operations */
19
void btrfs_discard_check_filter(struct btrfs_block_group *block_group, u64 bytes);
20
21
/* Work operations */
22
void btrfs_discard_cancel_work(struct btrfs_discard_ctl *discard_ctl,
23
struct btrfs_block_group *block_group);
24
void btrfs_discard_queue_work(struct btrfs_discard_ctl *discard_ctl,
25
struct btrfs_block_group *block_group);
26
void btrfs_discard_schedule_work(struct btrfs_discard_ctl *discard_ctl,
27
bool override);
28
29
/* Update operations */
30
void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);
31
void btrfs_discard_update_discardable(struct btrfs_block_group *block_group);
32
33
/* Setup/cleanup operations */
34
void btrfs_discard_punt_unused_bgs_list(struct btrfs_fs_info *fs_info);
35
void btrfs_discard_resume(struct btrfs_fs_info *fs_info);
36
void btrfs_discard_stop(struct btrfs_fs_info *fs_info);
37
void btrfs_discard_init(struct btrfs_fs_info *fs_info);
38
void btrfs_discard_cleanup(struct btrfs_fs_info *fs_info);
39
40
#endif
41
42