sysfs.c (1df2bc3c8252261860787a02f61797a914b99163) sysfs.c (009a8241a8e5a14ea2dd0b8db42dbf283527dd44)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * f2fs sysfs interface
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 * Copyright (c) 2017 Chao Yu <chao@kernel.org>
8 */

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

782 if (t > 100)
783 return -EINVAL;
784 if (t == *ui)
785 return count;
786 *ui = (unsigned int)t;
787 return count;
788 }
789
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * f2fs sysfs interface
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 * Copyright (c) 2017 Chao Yu <chao@kernel.org>
8 */

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

782 if (t > 100)
783 return -EINVAL;
784 if (t == *ui)
785 return count;
786 *ui = (unsigned int)t;
787 return count;
788 }
789
790 if (!strcmp(a->attr.name, "max_read_extent_count")) {
791 if (t > UINT_MAX)
792 return -EINVAL;
793 *ui = (unsigned int)t;
794 return count;
795 }
796
790 if (!strcmp(a->attr.name, "ipu_policy")) {
791 if (t >= BIT(F2FS_IPU_MAX))
792 return -EINVAL;
793 /* allow F2FS_IPU_NOCACHE only for IPU in the pinned file */
794 if (f2fs_lfs_mode(sbi) && (t & ~BIT(F2FS_IPU_NOCACHE)))
795 return -EINVAL;
796 SM_I(sbi)->ipu_policy = (unsigned int)t;
797 return count;

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

1047F2FS_SBI_GENERAL_RO_ATTR(current_atomic_write);
1048F2FS_SBI_GENERAL_RW_ATTR(peak_atomic_write);
1049F2FS_SBI_GENERAL_RW_ATTR(committed_atomic_block);
1050F2FS_SBI_GENERAL_RW_ATTR(revoked_atomic_block);
1051/* block age extent cache */
1052F2FS_SBI_GENERAL_RW_ATTR(hot_data_age_threshold);
1053F2FS_SBI_GENERAL_RW_ATTR(warm_data_age_threshold);
1054F2FS_SBI_GENERAL_RW_ATTR(last_age_weight);
797 if (!strcmp(a->attr.name, "ipu_policy")) {
798 if (t >= BIT(F2FS_IPU_MAX))
799 return -EINVAL;
800 /* allow F2FS_IPU_NOCACHE only for IPU in the pinned file */
801 if (f2fs_lfs_mode(sbi) && (t & ~BIT(F2FS_IPU_NOCACHE)))
802 return -EINVAL;
803 SM_I(sbi)->ipu_policy = (unsigned int)t;
804 return count;

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

1054F2FS_SBI_GENERAL_RO_ATTR(current_atomic_write);
1055F2FS_SBI_GENERAL_RW_ATTR(peak_atomic_write);
1056F2FS_SBI_GENERAL_RW_ATTR(committed_atomic_block);
1057F2FS_SBI_GENERAL_RW_ATTR(revoked_atomic_block);
1058/* block age extent cache */
1059F2FS_SBI_GENERAL_RW_ATTR(hot_data_age_threshold);
1060F2FS_SBI_GENERAL_RW_ATTR(warm_data_age_threshold);
1061F2FS_SBI_GENERAL_RW_ATTR(last_age_weight);
1062/* read extent cache */
1063F2FS_SBI_GENERAL_RW_ATTR(max_read_extent_count);
1055#ifdef CONFIG_BLK_DEV_ZONED
1056F2FS_SBI_GENERAL_RO_ATTR(unusable_blocks_per_sec);
1057F2FS_SBI_GENERAL_RW_ATTR(blkzone_alloc_policy);
1058#endif
1059
1060/* STAT_INFO ATTR */
1061#ifdef CONFIG_F2FS_STAT_FS
1062STAT_INFO_RO_ATTR(cp_foreground_calls, cp_call_count[FOREGROUND]);

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

1237 ATTR_LIST(max_fragment_hole),
1238 ATTR_LIST(current_atomic_write),
1239 ATTR_LIST(peak_atomic_write),
1240 ATTR_LIST(committed_atomic_block),
1241 ATTR_LIST(revoked_atomic_block),
1242 ATTR_LIST(hot_data_age_threshold),
1243 ATTR_LIST(warm_data_age_threshold),
1244 ATTR_LIST(last_age_weight),
1064#ifdef CONFIG_BLK_DEV_ZONED
1065F2FS_SBI_GENERAL_RO_ATTR(unusable_blocks_per_sec);
1066F2FS_SBI_GENERAL_RW_ATTR(blkzone_alloc_policy);
1067#endif
1068
1069/* STAT_INFO ATTR */
1070#ifdef CONFIG_F2FS_STAT_FS
1071STAT_INFO_RO_ATTR(cp_foreground_calls, cp_call_count[FOREGROUND]);

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

1246 ATTR_LIST(max_fragment_hole),
1247 ATTR_LIST(current_atomic_write),
1248 ATTR_LIST(peak_atomic_write),
1249 ATTR_LIST(committed_atomic_block),
1250 ATTR_LIST(revoked_atomic_block),
1251 ATTR_LIST(hot_data_age_threshold),
1252 ATTR_LIST(warm_data_age_threshold),
1253 ATTR_LIST(last_age_weight),
1254 ATTR_LIST(max_read_extent_count),
1245 NULL,
1246};
1247ATTRIBUTE_GROUPS(f2fs);
1248
1249static struct attribute *f2fs_feat_attrs[] = {
1250#ifdef CONFIG_FS_ENCRYPTION
1251 ATTR_LIST(encryption),
1252 ATTR_LIST(test_dummy_encryption_v2),

--- 439 unchanged lines hidden ---
1255 NULL,
1256};
1257ATTRIBUTE_GROUPS(f2fs);
1258
1259static struct attribute *f2fs_feat_attrs[] = {
1260#ifdef CONFIG_FS_ENCRYPTION
1261 ATTR_LIST(encryption),
1262 ATTR_LIST(test_dummy_encryption_v2),

--- 439 unchanged lines hidden ---