mount_opt
if (!btrfs_check_options(fs_info, &fs_info->mount_opt, sb->s_flags)) {
#define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \
if (unlikely(fs_info->mount_opt & BTRFS_MOUNT_FULL_RO_MASK))
unsigned long long mount_opt;
btrfs_clear_opt(fs_info->mount_opt, REF_VERIFY);
btrfs_clear_opt(fs_info->mount_opt, REF_VERIFY);
btrfs_clear_opt(fs_info->mount_opt, REF_VERIFY);
(!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) ||
(!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) || sb_rdonly(fs_info->sb))) {
fs_info->mount_opt = ctx->mount_opt;
ctx->mount_opt = fs_info->mount_opt;
if ((!old_ctx || !btrfs_raw_test_opt(old_ctx->mount_opt, opt)) && \
btrfs_raw_test_opt(fs_info->mount_opt, opt)) \
if ((old_ctx && btrfs_raw_test_opt(old_ctx->mount_opt, opt)) && \
!btrfs_raw_test_opt(fs_info->mount_opt, opt)) \
(!btrfs_raw_test_opt(old->mount_opt, FORCE_COMPRESS) &&
btrfs_raw_test_opt(info->mount_opt, FORCE_COMPRESS)))) {
ctx->mount_opt = old_ctx.mount_opt;
if (!btrfs_check_options(fs_info, &ctx->mount_opt, fc->sb_flags)) {
btrfs_remount_begin(fs_info, old_ctx.mount_opt, fc->sb_flags);
btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
btrfs_clear_opt(fs_info->mount_opt, SPACE_CACHE);
btrfs_clear_opt(fs_info->mount_opt, FREE_SPACE_TREE);
btrfs_set_opt(fs_info->mount_opt, SPACE_CACHE);
btrfs_remount_cleanup(fs_info, old_ctx.mount_opt);
btrfs_remount_cleanup(fs_info, old_ctx.mount_opt);
btrfs_set_opt(fs_info->mount_opt, DEGRADED);
btrfs_clear_opt(ctx->mount_opt, FORCE_COMPRESS);
btrfs_set_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_clear_opt(ctx->mount_opt, NODATASUM);
btrfs_set_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_clear_opt(ctx->mount_opt, NODATASUM);
btrfs_set_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_clear_opt(ctx->mount_opt, NODATASUM);
btrfs_set_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_clear_opt(ctx->mount_opt, NODATASUM);
btrfs_clear_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, FORCE_COMPRESS);
btrfs_set_opt(ctx->mount_opt, DEGRADED);
btrfs_set_opt(ctx->mount_opt, NODATASUM);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_clear_opt(ctx->mount_opt, NODATASUM);
btrfs_clear_opt(ctx->mount_opt, COMPRESS);
btrfs_clear_opt(ctx->mount_opt, FORCE_COMPRESS);
btrfs_set_opt(ctx->mount_opt, NODATACOW);
btrfs_set_opt(ctx->mount_opt, NODATASUM);
btrfs_clear_opt(ctx->mount_opt, NODATACOW);
btrfs_set_opt(ctx->mount_opt, FORCE_COMPRESS);
btrfs_set_opt(ctx->mount_opt, NOSSD);
btrfs_clear_opt(ctx->mount_opt, SSD);
btrfs_clear_opt(ctx->mount_opt, SSD_SPREAD);
btrfs_set_opt(ctx->mount_opt, SSD);
btrfs_clear_opt(ctx->mount_opt, NOSSD);
btrfs_clear_opt(ctx->mount_opt, SSD_SPREAD);
btrfs_set_opt(ctx->mount_opt, SSD);
btrfs_set_opt(ctx->mount_opt, SSD_SPREAD);
btrfs_clear_opt(ctx->mount_opt, NOSSD);
btrfs_set_opt(ctx->mount_opt, NOBARRIER);
btrfs_clear_opt(ctx->mount_opt, NOBARRIER);
btrfs_set_opt(ctx->mount_opt, NOTREELOG);
btrfs_clear_opt(ctx->mount_opt, NOTREELOG);
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
btrfs_clear_opt(ctx->mount_opt, FLUSHONCOMMIT);
btrfs_set_opt(ctx->mount_opt, FLUSHONCOMMIT);
btrfs_clear_opt(ctx->mount_opt, DISCARD_SYNC);
btrfs_clear_opt(ctx->mount_opt, DISCARD_ASYNC);
btrfs_set_opt(ctx->mount_opt, NODISCARD);
btrfs_set_opt(ctx->mount_opt, DISCARD_SYNC);
btrfs_clear_opt(ctx->mount_opt, DISCARD_ASYNC);
btrfs_clear_opt(ctx->mount_opt, DISCARD_ASYNC);
btrfs_set_opt(ctx->mount_opt, DISCARD_SYNC);
btrfs_clear_opt(ctx->mount_opt, DISCARD_SYNC);
btrfs_set_opt(ctx->mount_opt, DISCARD_ASYNC);
btrfs_clear_opt(ctx->mount_opt, NODISCARD);
btrfs_set_opt(ctx->mount_opt, NOSPACECACHE);
btrfs_clear_opt(ctx->mount_opt, SPACE_CACHE);
btrfs_clear_opt(ctx->mount_opt, FREE_SPACE_TREE);
btrfs_clear_opt(ctx->mount_opt, FREE_SPACE_TREE);
btrfs_set_opt(ctx->mount_opt, SPACE_CACHE);
btrfs_set_opt(ctx->mount_opt, SPACE_CACHE);
btrfs_clear_opt(ctx->mount_opt, FREE_SPACE_TREE);
btrfs_clear_opt(ctx->mount_opt, SPACE_CACHE);
btrfs_set_opt(ctx->mount_opt, FREE_SPACE_TREE);
btrfs_set_opt(ctx->mount_opt, RESCAN_UUID_TREE);
btrfs_set_opt(ctx->mount_opt, CLEAR_CACHE);
btrfs_set_opt(ctx->mount_opt, USER_SUBVOL_RM_ALLOWED);
btrfs_clear_opt(ctx->mount_opt, ENOSPC_DEBUG);
btrfs_set_opt(ctx->mount_opt, ENOSPC_DEBUG);
btrfs_clear_opt(ctx->mount_opt, AUTO_DEFRAG);
btrfs_set_opt(ctx->mount_opt, AUTO_DEFRAG);
btrfs_set_opt(ctx->mount_opt, USEBACKUPROOT);
btrfs_set_opt(ctx->mount_opt, CLEAR_CACHE);
btrfs_set_opt(ctx->mount_opt, SKIP_BALANCE);
btrfs_set_opt(ctx->mount_opt, PANIC_ON_FATAL_ERROR);
btrfs_clear_opt(ctx->mount_opt, PANIC_ON_FATAL_ERROR);
btrfs_set_opt(ctx->mount_opt, USEBACKUPROOT);
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
btrfs_set_opt(ctx->mount_opt, IGNOREBADROOTS);
btrfs_set_opt(ctx->mount_opt, IGNOREDATACSUMS);
btrfs_set_opt(ctx->mount_opt, IGNOREMETACSUMS);
btrfs_set_opt(ctx->mount_opt, IGNORESUPERFLAGS);
btrfs_set_opt(ctx->mount_opt, IGNOREDATACSUMS);
btrfs_set_opt(ctx->mount_opt, IGNOREMETACSUMS);
btrfs_set_opt(ctx->mount_opt, IGNORESUPERFLAGS);
btrfs_set_opt(ctx->mount_opt, IGNOREBADROOTS);
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
btrfs_set_opt(ctx->mount_opt, FRAGMENT_DATA);
btrfs_set_opt(ctx->mount_opt, FRAGMENT_METADATA);
btrfs_set_opt(ctx->mount_opt, FRAGMENT_METADATA);
btrfs_set_opt(ctx->mount_opt, FRAGMENT_DATA);
btrfs_set_opt(ctx->mount_opt, REF_VERIFY);
btrfs_set_opt(ctx->mount_opt, REF_TRACKER);
btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);
btrfs_clear_opt(fs_info->mount_opt, CLEAR_CACHE);
btrfs_clear_opt(fs_info->mount_opt, NOSPACECACHE);
unsigned long long mount_opt, unsigned long long opt,
if (mount_opt & opt) {
unsigned long long *mount_opt,
(check_ro_option(info, *mount_opt, BTRFS_MOUNT_NOLOGREPLAY, "nologreplay") ||
check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREBADROOTS, "ignorebadroots") ||
check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREDATACSUMS, "ignoredatacsums") ||
check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREMETACSUMS, "ignoremetacsums") ||
check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNORESUPERFLAGS, "ignoresuperflags")))
!btrfs_raw_test_opt(*mount_opt, FREE_SPACE_TREE) &&
!btrfs_raw_test_opt(*mount_opt, CLEAR_CACHE)) {
!btrfs_raw_test_opt(*mount_opt, FREE_SPACE_TREE)) {
if (btrfs_check_mountopts_zoned(info, mount_opt))
if (btrfs_raw_test_opt(*mount_opt, SPACE_CACHE)) {
btrfs_clear_opt(fs_info->mount_opt, SPACE_CACHE);
btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
btrfs_set_opt(fs_info->mount_opt, SPACE_CACHE);
btrfs_set_opt(fs_info->mount_opt, SSD);
btrfs_set_opt(fs_info->mount_opt, DISCARD_ASYNC);
unsigned long long mount_opt;
unsigned long long *mount_opt,
btrfs_set_opt(fs_info->mount_opt, DEGRADED);
btrfs_clear_opt(fs_info->mount_opt, DEGRADED);
ret = btrfs_check_mountopts_zoned(fs_info, &fs_info->mount_opt);
unsigned long long *mount_opt)
if (btrfs_raw_test_opt(*mount_opt, SPACE_CACHE)) {
if (btrfs_raw_test_opt(*mount_opt, NODATACOW)) {
if (btrfs_raw_test_opt(*mount_opt, DISCARD_ASYNC)) {
btrfs_clear_opt(*mount_opt, DISCARD_ASYNC);
unsigned long long *mount_opt)
unsigned long long *mount_opt);
#define clear_opt(opt, option) ((opt)->mount_opt &= ~EROFS_MOUNT_##option)
#define set_opt(opt, option) ((opt)->mount_opt |= EROFS_MOUNT_##option)
#define test_opt(opt, option) ((opt)->mount_opt & EROFS_MOUNT_##option)
unsigned int mount_opt;
int mount_opt;
EXT4_SET_CTX(mount_opt);
EXT4_CLEAR_CTX(mount_opt);
EXT4_TEST_CTX(mount_opt);
if (m->mount_opt & EXT4_MOUNT_DELALLOC) {
} else if (m->mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) {
ctx_set_mount_opt(ctx, m->mount_opt);
ctx_clear_mount_opt(ctx, m->mount_opt);
ctx_set_mount_opt2(ctx, m->mount_opt);
ctx_clear_mount_opt2(ctx, m->mount_opt);
ctx_set_mount_opt(ctx, m->mount_opt);
ctx_clear_mount_opt(ctx, m->mount_opt);
unsigned int mount_opt, def_mount_opt;
mount_opt = sbi->s_mount_opt2;
mount_opt = sbi->s_mount_opt;
if (!nodefs && !(m->mount_opt & (mount_opt ^ def_mount_opt)))
(mount_opt & m->mount_opt) != m->mount_opt) ||
(!want_set && (mount_opt & m->mount_opt)))
#define F2FS_OPTION(sbi) ((sbi)->mount_opt)
struct f2fs_mount_info mount_opt; /* mount options */
org_mount_opt = sbi->mount_opt;
sbi->mount_opt = org_mount_opt;
osb->s_mount_opt = parsed_options->mount_opt;
mopt->mount_opt = OCFS2_MOUNT_NOINTR;
tmp = options->mount_opt & (OCFS2_MOUNT_HB_LOCAL |
if (options->mount_opt & OCFS2_MOUNT_USRQUOTA &&
if (options->mount_opt & OCFS2_MOUNT_GRPQUOTA &&
if (options->mount_opt & OCFS2_MOUNT_POSIX_ACL &&
if (!(options->mount_opt & (OCFS2_MOUNT_POSIX_ACL |
options->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
options->mount_opt |= OCFS2_MOUNT_NO_POSIX_ACL;
mopt->mount_opt |= result.uint_32;
mopt->mount_opt |= OCFS2_MOUNT_BARRIER;
mopt->mount_opt &= ~OCFS2_MOUNT_BARRIER;
mopt->mount_opt |= OCFS2_MOUNT_NOINTR;
mopt->mount_opt &= ~OCFS2_MOUNT_NOINTR;
mopt->mount_opt &= ~(OCFS2_MOUNT_ERRORS_CONT |
mopt->mount_opt |= result.uint_32;
mopt->mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK;
mopt->mount_opt |= result.uint_32;
mopt->mount_opt |= OCFS2_MOUNT_NOUSERXATTR;
mopt->mount_opt &= ~OCFS2_MOUNT_NOUSERXATTR;
mopt->mount_opt |= OCFS2_MOUNT_LOCALFLOCKS;
mopt->mount_opt |= OCFS2_MOUNT_INODE64;
mopt->mount_opt |= OCFS2_MOUNT_USRQUOTA;
mopt->mount_opt |= OCFS2_MOUNT_GRPQUOTA;
mopt->mount_opt &= ~OCFS2_MOUNT_COHERENCY_BUFFERED;
mopt->mount_opt |= result.uint_32;
mopt->mount_opt |= OCFS2_MOUNT_NO_POSIX_ACL;
mopt->mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
mopt->mount_opt &= ~OCFS2_MOUNT_NO_POSIX_ACL;
mopt->mount_opt |= OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT;
if ((osb->s_mount_opt & tmp) != (parsed_options->mount_opt & tmp)) {
(parsed_options->mount_opt & OCFS2_MOUNT_DATA_WRITEBACK)) {
(parsed_options->mount_opt & OCFS2_MOUNT_INODE64)) {
osb->s_mount_opt = parsed_options->mount_opt;
unsigned long mount_opt;
ASSERT_EQ(0, mount_opt(&mnt_tmp, dir_s1d2));
ASSERT_EQ(-1, mount_opt(&mnt_tmp, dir_s1d2));
ASSERT_EQ(0, mount_opt(&mnt_tmp, dir_s3d2));
ASSERT_EQ(0, mount_opt(mnt, TMP_DIR))
ASSERT_EQ(0, mount_opt(&mnt_tmp, dir_s3d2));
ASSERT_EQ(0, mount_opt(&mnt_tmp, LOWER_BASE));
ASSERT_EQ(0, mount_opt(&mnt_tmp, UPPER_BASE));
ASSERT_EQ(0, mount_opt(&mnt_tmp, TMP_DIR));