39 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2 3#ifndef BTRFS_SUPER_H4#define BTRFS_SUPER_H5 6#include <linux/types.h>7#include <linux/fs.h>8#include "fs.h"9 10struct super_block;11struct btrfs_fs_info;12 13bool btrfs_check_options(const struct btrfs_fs_info *info,14 unsigned long long *mount_opt,15 unsigned long flags);16int btrfs_sync_fs(struct super_block *sb, int wait);17char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,18 u64 subvol_objectid);19void btrfs_set_free_space_cache_settings(struct btrfs_fs_info *fs_info);20 21static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)22{23 return sb->s_fs_info;24}25 26static inline void btrfs_set_sb_rdonly(struct super_block *sb)27{28 sb->s_flags |= SB_RDONLY;29 set_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);30}31 32static inline void btrfs_clear_sb_rdonly(struct super_block *sb)33{34 sb->s_flags &= ~SB_RDONLY;35 clear_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);36}37 38#endif39