u64 start, u64 len)
{
if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout)) {
-#ifdef CONFIG_EROFS_FS_ZIP
+ if (!IS_ENABLED(CONFIG_EROFS_FS_ZIP))
+ return -EOPNOTSUPP;
return iomap_fiemap(inode, fieinfo, start, len,
&z_erofs_iomap_report_ops);
-#else
- return -EOPNOTSUPP;
-#endif
}
return iomap_fiemap(inode, fieinfo, start, len, &erofs_iomap_ops);
}
if (!iov_iter_count(to))
return 0;
-#ifdef CONFIG_FS_DAX
- if (IS_DAX(inode))
+ if (IS_ENABLED(CONFIG_FS_DAX) && IS_DAX(inode))
return dax_iomap_rw(iocb, to, &erofs_iomap_ops);
-#endif
+
if ((iocb->ki_flags & IOCB_DIRECT) && inode->i_sb->s_bdev) {
struct erofs_iomap_iter_ctx iter_ctx = {
.realinode = inode,
struct inode *inode = file->f_mapping->host;
const struct iomap_ops *ops = &erofs_iomap_ops;
- if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout))
-#ifdef CONFIG_EROFS_FS_ZIP
+ if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout)) {
+ if (!IS_ENABLED(CONFIG_EROFS_FS_ZIP))
+ return generic_file_llseek(file, offset, whence);
ops = &z_erofs_iomap_report_ops;
-#else
- return generic_file_llseek(file, offset, whence);
-#endif
+ }
if (whence == SEEK_HOLE)
offset = iomap_seek_hole(inode, offset, ops);
sbi->opt.cache_strategy = EROFS_ZIP_CACHE_READAROUND;
sbi->sync_decompress = EROFS_SYNC_DECOMPRESS_AUTO;
#endif
-#ifdef CONFIG_EROFS_FS_XATTR
- set_opt(&sbi->opt, XATTR_USER);
-#endif
-#ifdef CONFIG_EROFS_FS_POSIX_ACL
- set_opt(&sbi->opt, POSIX_ACL);
-#endif
+ if (IS_ENABLED(CONFIG_EROFS_FS_XATTR))
+ set_opt(&sbi->opt, XATTR_USER);
+ if (IS_ENABLED(CONFIG_EROFS_FS_POSIX_ACL))
+ set_opt(&sbi->opt, POSIX_ACL);
}
enum {
static void erofs_evict_inode(struct inode *inode)
{
-#ifdef CONFIG_FS_DAX
if (IS_DAX(inode))
dax_break_layout_final(inode);
-#endif
-
erofs_ishare_free_inode(inode);
truncate_inode_pages_final(&inode->i_data);
clear_inode(inode);
return ret;
if (t != (unsigned int)t)
return -ERANGE;
-#ifdef CONFIG_EROFS_FS_ZIP
- if (!strcmp(a->attr.name, "sync_decompress") &&
+ if (IS_ENABLED(CONFIG_EROFS_FS_ZIP) &&
+ !strcmp(a->attr.name, "sync_decompress") &&
(t > EROFS_SYNC_DECOMPRESS_FORCE_OFF))
return -EINVAL;
-#endif
*(unsigned int *)ptr = t;
return len;
case attr_pointer_bool: