f2fs.h (0916878da355650d7e77104a7ac0fa1784eca852) f2fs.h (95175dafc4399ab5b9e937da205b2a6927b19227)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/f2fs.h
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#ifndef _LINUX_F2FS_H

--- 1054 unchanged lines hidden (view full) ---

1063#define RDEV(i) (raw_super->devs[i])
1064struct f2fs_dev_info {
1065 struct block_device *bdev;
1066 char path[MAX_PATH_LEN];
1067 unsigned int total_segments;
1068 block_t start_blk;
1069 block_t end_blk;
1070#ifdef CONFIG_BLK_DEV_ZONED
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/f2fs.h
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#ifndef _LINUX_F2FS_H

--- 1054 unchanged lines hidden (view full) ---

1063#define RDEV(i) (raw_super->devs[i])
1064struct f2fs_dev_info {
1065 struct block_device *bdev;
1066 char path[MAX_PATH_LEN];
1067 unsigned int total_segments;
1068 block_t start_blk;
1069 block_t end_blk;
1070#ifdef CONFIG_BLK_DEV_ZONED
1071 unsigned int nr_blkz; /* Total number of zones */
1072 u8 *blkz_type; /* Array of zones type */
1071 unsigned int nr_blkz; /* Total number of zones */
1072 unsigned long *blkz_seq; /* Bitmap indicating sequential zones */
1073#endif
1074};
1075
1076enum inode_type {
1077 DIR_INODE, /* for dirty dir inode */
1078 FILE_INODE, /* for dirty regular/symlink inode */
1079 DIRTY_META, /* for all dirtied inode metadata */
1080 ATOMIC_FILE, /* for all atomic files */

--- 2456 unchanged lines hidden (view full) ---

3537F2FS_FEATURE_FUNCS(inode_chksum, INODE_CHKSUM);
3538F2FS_FEATURE_FUNCS(flexible_inline_xattr, FLEXIBLE_INLINE_XATTR);
3539F2FS_FEATURE_FUNCS(quota_ino, QUOTA_INO);
3540F2FS_FEATURE_FUNCS(inode_crtime, INODE_CRTIME);
3541F2FS_FEATURE_FUNCS(lost_found, LOST_FOUND);
3542F2FS_FEATURE_FUNCS(sb_chksum, SB_CHKSUM);
3543
3544#ifdef CONFIG_BLK_DEV_ZONED
1073#endif
1074};
1075
1076enum inode_type {
1077 DIR_INODE, /* for dirty dir inode */
1078 FILE_INODE, /* for dirty regular/symlink inode */
1079 DIRTY_META, /* for all dirtied inode metadata */
1080 ATOMIC_FILE, /* for all atomic files */

--- 2456 unchanged lines hidden (view full) ---

3537F2FS_FEATURE_FUNCS(inode_chksum, INODE_CHKSUM);
3538F2FS_FEATURE_FUNCS(flexible_inline_xattr, FLEXIBLE_INLINE_XATTR);
3539F2FS_FEATURE_FUNCS(quota_ino, QUOTA_INO);
3540F2FS_FEATURE_FUNCS(inode_crtime, INODE_CRTIME);
3541F2FS_FEATURE_FUNCS(lost_found, LOST_FOUND);
3542F2FS_FEATURE_FUNCS(sb_chksum, SB_CHKSUM);
3543
3544#ifdef CONFIG_BLK_DEV_ZONED
3545static inline int get_blkz_type(struct f2fs_sb_info *sbi,
3546 struct block_device *bdev, block_t blkaddr)
3545static inline bool f2fs_blkz_is_seq(struct f2fs_sb_info *sbi, int devi,
3546 block_t blkaddr)
3547{
3548 unsigned int zno = blkaddr >> sbi->log_blocks_per_blkz;
3547{
3548 unsigned int zno = blkaddr >> sbi->log_blocks_per_blkz;
3549 int i;
3550
3549
3551 for (i = 0; i < sbi->s_ndevs; i++)
3552 if (FDEV(i).bdev == bdev)
3553 return FDEV(i).blkz_type[zno];
3554 return -EINVAL;
3550 return test_bit(zno, FDEV(devi).blkz_seq);
3555}
3556#endif
3557
3558static inline bool f2fs_hw_should_discard(struct f2fs_sb_info *sbi)
3559{
3560 return f2fs_sb_has_blkzoned(sbi);
3561}
3562

--- 104 unchanged lines hidden ---
3551}
3552#endif
3553
3554static inline bool f2fs_hw_should_discard(struct f2fs_sb_info *sbi)
3555{
3556 return f2fs_sb_has_blkzoned(sbi);
3557}
3558

--- 104 unchanged lines hidden ---