2022-10-27 03:08:39 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
|
|
|
#ifndef BTRFS_SUPER_H
|
|
|
|
#define BTRFS_SUPER_H
|
|
|
|
|
2024-01-27 07:53:06 +08:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include "fs.h"
|
|
|
|
|
|
|
|
struct super_block;
|
|
|
|
struct btrfs_fs_info;
|
|
|
|
|
2024-07-13 17:03:44 +08:00
|
|
|
bool btrfs_check_options(const struct btrfs_fs_info *info,
|
|
|
|
unsigned long long *mount_opt,
|
2023-11-23 01:17:50 +08:00
|
|
|
unsigned long flags);
|
2022-10-27 03:08:39 +08:00
|
|
|
int btrfs_sync_fs(struct super_block *sb, int wait);
|
|
|
|
char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
|
|
|
|
u64 subvol_objectid);
|
2023-11-23 01:17:40 +08:00
|
|
|
void btrfs_set_free_space_cache_settings(struct btrfs_fs_info *fs_info);
|
2022-10-27 03:08:39 +08:00
|
|
|
|
2022-10-27 03:08:40 +08:00
|
|
|
static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)
|
|
|
|
{
|
|
|
|
return sb->s_fs_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void btrfs_set_sb_rdonly(struct super_block *sb)
|
|
|
|
{
|
|
|
|
sb->s_flags |= SB_RDONLY;
|
|
|
|
set_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void btrfs_clear_sb_rdonly(struct super_block *sb)
|
|
|
|
{
|
|
|
|
sb->s_flags &= ~SB_RDONLY;
|
|
|
|
clear_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
|
|
|
|
}
|
|
|
|
|
2022-10-27 03:08:39 +08:00
|
|
|
#endif
|