diff mbox series

[f2fs-dev] f2fs: clean up the unused variable additional_reserved_segments

Message ID 20241029104907.310781-1-weilongping@oppo.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] f2fs: clean up the unused variable additional_reserved_segments | expand

Commit Message

LongPing Wei Oct. 29, 2024, 10:49 a.m. UTC
additional_reserved_segments was introduced by
commit 300a842937fb ("f2fs: fix to reserve space for IO align feature"),
and its initialization was deleted by
commit 87161a2b0aed ("f2fs: deprecate io_bits").

Signed-off-by: LongPing Wei <weilongping@oppo.com>
---
 fs/f2fs/f2fs.h    | 1 -
 fs/f2fs/segment.h | 3 +--
 fs/f2fs/sysfs.c   | 4 +---
 3 files changed, 2 insertions(+), 6 deletions(-)

Comments

Chao Yu Oct. 30, 2024, 1:15 a.m. UTC | #1
On 2024/10/29 18:49, LongPing Wei wrote:
> additional_reserved_segments was introduced by
> commit 300a842937fb ("f2fs: fix to reserve space for IO align feature"),
> and its initialization was deleted by
> commit 87161a2b0aed ("f2fs: deprecate io_bits").
> 
> Signed-off-by: LongPing Wei <weilongping@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c13812dc7d3b..119706dbaefa 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1064,7 +1064,6 @@  struct f2fs_sm_info {
 	unsigned int segment_count;	/* total # of segments */
 	unsigned int main_segments;	/* # of segments in main area */
 	unsigned int reserved_segments;	/* # of reserved segments */
-	unsigned int additional_reserved_segments;/* reserved segs for IO align feature */
 	unsigned int ovp_segments;	/* # of overprovision segments */
 
 	/* a threshold to reclaim prefree segments */
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index d440fdb83ca4..943be4f1d6d2 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -522,8 +522,7 @@  static inline unsigned int free_segments(struct f2fs_sb_info *sbi)
 
 static inline unsigned int reserved_segments(struct f2fs_sb_info *sbi)
 {
-	return SM_I(sbi)->reserved_segments +
-			SM_I(sbi)->additional_reserved_segments;
+	return SM_I(sbi)->reserved_segments;
 }
 
 static inline unsigned int free_sections(struct f2fs_sb_info *sbi)
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index e51304bc65ea..bdbf24db667b 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -501,9 +501,7 @@  static ssize_t __sbi_store(struct f2fs_attr *a,
 	if (a->struct_type == RESERVED_BLOCKS) {
 		spin_lock(&sbi->stat_lock);
 		if (t > (unsigned long)(sbi->user_block_count -
-				F2FS_OPTION(sbi).root_reserved_blocks -
-				SEGS_TO_BLKS(sbi,
-				SM_I(sbi)->additional_reserved_segments))) {
+				F2FS_OPTION(sbi).root_reserved_blocks)) {
 			spin_unlock(&sbi->stat_lock);
 			return -EINVAL;
 		}