test_opt
if (test_opt(&EROFS_SB(rq->sb)->opt, DIRECT_IO) &&
if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) &&
seq_puts(seq, test_opt(opt, XATTR_USER) ?
seq_puts(seq, test_opt(opt, POSIX_ACL) ? ",acl" : ",noacl");
if (test_opt(opt, DAX_ALWAYS))
if (test_opt(opt, DAX_NEVER))
if (erofs_is_fileio_mode(sbi) && test_opt(opt, DIRECT_IO))
if (test_opt(opt, INODE_SHARE))
if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
if (test_opt(&sbi->opt, DAX_ALWAYS) && !sbi->dif0.dax_dev) {
if (!sbi->domain_id && test_opt(&sbi->opt, INODE_SHARE)) {
if (test_opt(&sbi->opt, DAX_ALWAYS) && test_opt(&sbi->opt, INODE_SHARE)) {
if (test_opt(&sbi->opt, DAX_ALWAYS) && sbi->blkszbits != PAGE_SHIFT) {
if (test_opt(&sbi->opt, INODE_SHARE) && !erofs_sb_has_ishare_xattrs(sbi)) {
if (test_opt(&sbi->opt, INODE_SHARE))
if (test_opt(&sbi->opt, POSIX_ACL))
if (test_opt(&new_sbi->opt, POSIX_ACL))
return test_opt(&EROFS_SB(dentry->d_sb)->opt, XATTR_USER);
!test_opt(&EROFS_I_SB(inode)->opt, XATTR_USER))
if (!test_opt(&sbi->opt, INODE_SHARE))
if (!test_opt(sb, RESERVATION))
if (test_opt(sb, OLDALLOC))
if (test_opt(sb, GRPID)) {
if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode))
if (!(test_opt (inode->i_sb, NO_UID32))) {
if (!(test_opt(sb, NO_UID32))) {
if (test_opt(inode->i_sb, RESERVATION)
if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
if (test_opt (sb, MINIX_DF))
if (test_opt(sb, MINIX_DF))
if (test_opt(sb, GRPID))
if (!test_opt(sb, GRPID) && (def_mount_opts & EXT2_DEFM_BSDGROUPS))
if (test_opt(sb, ERRORS_RO)) {
if (test_opt(sb, ERRORS_CONT))
if (test_opt(sb, ERRORS_PANIC))
if (test_opt(sb, NO_UID32))
if (test_opt(sb, DEBUG))
if (test_opt(sb, OLDALLOC))
if (test_opt(sb, XATTR_USER))
if (!test_opt(sb, XATTR_USER) &&
if (test_opt(sb, POSIX_ACL))
if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT2_DEFM_ACL))
if (test_opt(sb, USRQUOTA))
if (test_opt(sb, GRPQUOTA))
if (test_opt(sb, XIP))
if (test_opt(sb, DAX))
if (!test_opt(sb, RESERVATION))
if (test_opt (sb, DEBUG))
if (test_opt(sb, ERRORS_PANIC))
if (!sb_rdonly(sb) && test_opt(sb, ERRORS_RO)) {
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
if (test_opt(sb, DAX)) {
return test_opt(dentry->d_sb, XATTR_USER);
if (!test_opt(inode->i_sb, XATTR_USER))
if (!test_opt(inode->i_sb, XATTR_USER))
if (test_opt(sb, DISCARD)) {
if (test_opt(inode->i_sb, DELALLOC))
if (test_opt(sb, DEBUG))
return (test_opt(sb, QUOTA) || ext4_has_feature_quota(sb));
test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ||
!test_opt(inode->i_sb, DELALLOC))) {
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
test_opt(inode->i_sb, DATA_FLAGS));
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ||
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
if (!test_opt(inode->i_sb, DIOREAD_NOLOCK))
if (!test_opt(inode->i_sb, DELALLOC))
if (reserved == NULL || !test_opt(inode->i_sb, DELALLOC))
test_opt(inode->i_sb, DELALLOC) &&
if (test_opt(sb, BARRIER) && is_tail)
if (test_opt(inode->i_sb, BARRIER))
} else if (test_opt(sb, GRPID)) {
(test_opt(inode->i_sb, DELALLOC) ||
else if (test_opt(inode->i_sb, DELALLOC))
if (inode->i_size == 0 && !test_opt(inode->i_sb, NO_AUTO_DA_ALLOC))
if (!(test_opt(inode->i_sb, NO_UID32))) {
if (test_opt(inode->i_sb, DAX_ALWAYS))
if (!(test_opt(inode->i_sb, NO_UID32))) {
if (test_opt(inode->i_sb, DELALLOC) &&
test_opt(sb, INIT_INODE_TABLE))
if (test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb))
test_opt(inode->i_sb, DAX_ALWAYS))
test_opt(sb, INIT_INODE_TABLE))
if (test_opt(sb, DISCARD)) {
if (test_opt(sb, DISCARD)) {
if (test_opt(inode->i_sb, DELALLOC))
if (new.inode && !test_opt(new.dir->i_sb, NO_AUTO_DA_ALLOC))
if (test_opt(sb, DEBUG))
if (test_opt(sb, DEBUG))
if (test_opt(sb, DATA_ERR_ABORT))
if (test_opt(io_end->inode->i_sb, DATA_ERR_ABORT) &&
if (test_opt(sb, DEBUG))
if (test_opt(sb, DEBUG))
if (!test_opt(sb, INIT_INODE_TABLE))
if (test_opt(sb, DEBUG))
if (test_opt(sb, DEBUG))
if (test_opt(sb, DEBUG)) {
if (test_opt(sb, DEBUG))
if (test_opt(sb, ERRORS_CONT)) {
if (test_opt(sb, WARN_ON_ERROR))
test_opt(sb, USRQUOTA));
test_opt(sb, GRPQUOTA));
test_opt(sb, DATA_FLAGS)) {
(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) {
if (test_opt(sb, ERRORS_RO) && def_errors != EXT4_ERRORS_RO)
if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE)
if (test_opt(sb, ERRORS_PANIC) && def_errors != EXT4_ERRORS_PANIC)
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
if (test_opt(sb, INIT_INODE_TABLE) && (nodefs ||
if (test_opt(sb, DATA_ERR_ABORT))
if (test_opt(sb, DAX_ALWAYS)) {
if (nodefs && !test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS))
if (test_opt(sb, DEBUG))
test_opt(sb, INIT_INODE_TABLE)) {
if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS)) {
(test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
(first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE))))
if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
} else if (test_opt(sb, JOURNAL_CHECKSUM)) {
switch (test_opt(sb, DATA_FLAGS)) {
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA &&
test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
if (test_opt(sb, DAX_ALWAYS)) {
if (test_opt(sb, DELALLOC))
if (test_opt(sb, JOURNAL_ASYNC_COMMIT))
if (test_opt(sb, DATA_ERR_ABORT))
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) {
} else if (test_opt(sb, NOLOAD) && !sb_rdonly(sb) &&
if (!test_opt(sb, NO_MBCACHE)) {
if (test_opt(sb, BLOCK_VALIDITY)) {
if (test_opt(sb, DISCARD) && !bdev_max_discard_sectors(sb->s_bdev)) {
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
if (test_opt(sb, BARRIER))
(test_opt(sb, BARRIER) ? REQ_FUA : 0), sbh);
} else if (wait && test_opt(sb, BARRIER))
test_opt(sb, JOURNAL_CHECKSUM)) {
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
if (test_opt(sb, DIOREAD_NOLOCK)) {
} else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) {
if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
!test_opt(sb, DELALLOC)) {
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
if (test_opt(sb, BLOCK_VALIDITY) && !sbi->s_system_blks) {
if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks)
if (sb_rdonly(sb) || !test_opt(sb, INIT_INODE_TABLE))
if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks)
bool continue_fs = !force_ro && test_opt(sb, ERRORS_CONT);
if (!test_opt(sb, MINIX_DF))
if (test_opt(sb, WARN_ON_ERROR))
if (!test_opt(sb, QUOTA))
test_opt(sb, USRQUOTA),
test_opt(sb, GRPQUOTA),
test_opt(sb, PRJQUOTA),
if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) {
if (test_opt(sb, DELALLOC))
return test_opt(dentry->d_sb, XATTR_USER);
if (!test_opt(inode->i_sb, XATTR_USER))
if (!test_opt(inode->i_sb, XATTR_USER))
return test_opt(dentry->d_sb, XATTR_USER);
if (!test_opt(inode->i_sb, XATTR_USER))
if (!test_opt(inode->i_sb, XATTR_USER))
if (type != FILE_INODE || test_opt(sbi, DATA_FLUSH))
if (type == FILE_INODE && !test_opt(sbi, DATA_FLUSH))
if (!test_opt(sbi, MERGE_CHECKPOINT) || cpc.reason != CP_SYNC ||
if (!test_opt(sbi, COMPRESS_CACHE))
if (!test_opt(sbi, COMPRESS_CACHE))
if (!test_opt(sbi, COMPRESS_CACHE))
if (!test_opt(sbi, NOBARRIER))
if (test_opt(sbi, DISCARD))
return test_opt(F2FS_I_SB(inode), AGE_EXTENT_CACHE) &&
if (!test_opt(sbi, READ_EXTENT_CACHE))
if (!test_opt(sbi, AGE_EXTENT_CACHE))
return test_opt(F2FS_I_SB(inode), READ_EXTENT_CACHE) &&
if (test_opt(sbi, FASTBOOT))
if (test_opt(sbi, RESERVE_ROOT) && !__allow_reserved_root(sbi, inode, cap))
test_opt(sbi, RESERVE_NODE));
if (test_opt(sbi, RESERVE_NODE) &&
return (test_opt(sbi, DISCARD) && f2fs_hw_support_discard(sbi)) ||
else if (test_opt(sbi, FASTBOOT))
(test_opt(F2FS_I_SB(inode), COMPRESS_CACHE) &&
if (test_opt(sbi, ATGC) &&
if (test_opt(sbi, DISABLE_CHECKPOINT)) {
if (test_opt(sbi, GC_MERGE) && waitqueue_active(fggc_wq)) {
if (!test_opt(F2FS_I_SB(inode), INLINE_DENTRY))
test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode))
if (test_opt(sbi, INLINE_XATTR))
if (test_opt(sbi, INLINE_DATA) && f2fs_may_inline_data(inode))
if (name && !test_opt(sbi, DISABLE_EXT_IDENTIFY))
if (!test_opt(sbi, NOBARRIER))
if (!test_opt(sbi, NAT_BITS))
if (!test_opt(sbi, ATGC))
if (test_opt(sbi, GC_MERGE) && sbi->gc_thread &&
if (test_opt(sbi, DATA_FLUSH) && from_bg) {
trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER),
test_opt(sbi, FLUSH_MERGE), ret);
if (test_opt(sbi, NOBARRIER))
if (!test_opt(sbi, FLUSH_MERGE)) {
if (!test_opt(sbi, FLUSH_MERGE))
if (test_opt(sbi, NOBARRIER))
usrquota = test_opt(sbi, USRQUOTA) ||
grpquota = test_opt(sbi, GRPQUOTA) ||
prjquota = test_opt(sbi, PRJQUOTA) ||
if (test_opt(sbi, RESERVE_ROOT) &&
if (test_opt(sbi, RESERVE_NODE) &&
if (!ctx_test_opt(ctx, F2FS_MOUNT_INLINE_XATTR) && !test_opt(sbi, INLINE_XATTR)) {
!test_opt(sbi, READ_EXTENT_CACHE)) {
if (test_opt(sbi, DISCARD) && !f2fs_hw_support_discard(sbi))
if (test_opt(sbi, COMPRESS_CACHE))
if (test_opt(sbi, GC_MERGE))
if (test_opt(sbi, DISABLE_ROLL_FORWARD))
if (test_opt(sbi, NORECOVERY))
if (test_opt(sbi, DISCARD)) {
if (test_opt(sbi, XATTR_USER))
if (test_opt(sbi, INLINE_XATTR))
if (test_opt(sbi, INLINE_XATTR_SIZE))
if (test_opt(sbi, POSIX_ACL))
if (test_opt(sbi, DISABLE_EXT_IDENTIFY))
if (test_opt(sbi, INLINE_DATA))
if (test_opt(sbi, INLINE_DENTRY))
if (test_opt(sbi, FLUSH_MERGE))
if (test_opt(sbi, NOBARRIER))
if (test_opt(sbi, FASTBOOT))
if (test_opt(sbi, READ_EXTENT_CACHE))
if (test_opt(sbi, AGE_EXTENT_CACHE))
if (test_opt(sbi, DATA_FLUSH))
if (test_opt(sbi, RESERVE_ROOT) || test_opt(sbi, RESERVE_NODE))
if (test_opt(sbi, FAULT_INJECTION)) {
if (test_opt(sbi, QUOTA))
if (test_opt(sbi, USRQUOTA))
if (test_opt(sbi, GRPQUOTA))
if (test_opt(sbi, PRJQUOTA))
if (test_opt(sbi, DISABLE_CHECKPOINT))
if (test_opt(sbi, MERGE_CHECKPOINT))
if (test_opt(sbi, ATGC))
if (test_opt(sbi, NAT_BITS))
bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE);
bool no_age_extent_cache = !test_opt(sbi, AGE_EXTENT_CACHE);
bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT);
bool no_atgc = !test_opt(sbi, ATGC);
bool no_discard = !test_opt(sbi, DISCARD);
bool no_compress_cache = !test_opt(sbi, COMPRESS_CACHE);
bool no_nat_bits = !test_opt(sbi, NAT_BITS);
if (no_atgc == !!test_opt(sbi, ATGC)) {
if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) {
if (no_age_extent_cache == !!test_opt(sbi, AGE_EXTENT_CACHE)) {
if (no_compress_cache == !!test_opt(sbi, COMPRESS_CACHE)) {
if (no_nat_bits == !!test_opt(sbi, NAT_BITS)) {
if ((flags & SB_RDONLY) && test_opt(sbi, DISABLE_CHECKPOINT)) {
!test_opt(sbi, GC_MERGE))) {
if ((flags & SB_RDONLY) || !test_opt(sbi, FLUSH_MERGE)) {
if (no_discard == !!test_opt(sbi, DISCARD)) {
if (test_opt(sbi, DISCARD)) {
if (enable_checkpoint == !!test_opt(sbi, DISABLE_CHECKPOINT)) {
if (test_opt(sbi, DISABLE_CHECKPOINT)) {
if ((flags & SB_RDONLY) || test_opt(sbi, DISABLE_CHECKPOINT) ||
!test_opt(sbi, MERGE_CHECKPOINT)) {
(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
if (test_opt(sbi, DISABLE_ROLL_FORWARD))
if (test_opt(sbi, NORECOVERY))
test_opt(sbi, USRQUOTA),
test_opt(sbi, GRPQUOTA),
test_opt(sbi, PRJQUOTA),
(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
if (test_opt(sbi, INLINECRYPT))
if (test_opt(sbi, LAZYTIME))
if (test_opt(sbi, RESERVE_ROOT) &&
if (!f2fs_readonly(sb) && !test_opt(sbi, DISABLE_CHECKPOINT) &&
test_opt(sbi, MERGE_CHECKPOINT)) {
if (test_opt(sbi, RESERVE_NODE) &&
if (!test_opt(sbi, RESERVE_ROOT) && !test_opt(sbi, RESERVE_NODE) &&
if (!test_opt(sbi, DISABLE_ROLL_FORWARD) &&
!test_opt(sbi, NORECOVERY)) {
if (test_opt(sbi, DISABLE_CHECKPOINT))
test_opt(sbi, GC_MERGE)) && !f2fs_readonly(sb)) {
if (test_opt(sbi, COMPRESS_CACHE))
if (test_opt(sbi, DISABLE_CHECKPOINT))
if (test_opt(sbi, MERGE_CHECKPOINT)) {
if (!test_opt(sbi, XATTR_USER))
if (!test_opt(sbi, XATTR_USER))
return test_opt(sbi, XATTR_USER);
if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) !=
write_opt.regular.len = option_total_len(test_opt->flags);
write_test_option(test_opt, write_opt.regular.data);
struct bpf_test_option *test_opt, bool from_syn)
return parse_test_option(test_opt, search_opt.exprm.data);
return parse_test_option(test_opt, search_opt.regular.data);
struct bpf_test_option test_opt = {};
err = load_option(skops, &test_opt, true);
static void write_test_option(const struct bpf_test_option *test_opt,
data[offset++] = test_opt->flags;
if (TEST_OPTION_FLAGS(test_opt->flags, OPTION_MAX_DELACK_MS))
data[offset++] = test_opt->max_delack_ms;
if (TEST_OPTION_FLAGS(test_opt->flags, OPTION_RAND))
data[offset++] = test_opt->rand;
const struct bpf_test_option *test_opt)
write_opt.exprm.len = option_total_len(test_opt->flags);
write_test_option(test_opt, write_opt.exprm.data);