Skip to contentSkip to conversation

f2fs: add ioctl to do gc with target block address

PATCH New Jaegeuk Kim 1 participant 1 message Jun 17, 2017

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: add ioctl to do gc with target block address

This patch adds f2fs_ioc_gc_range() to move blocks located in the given range.

---
 fs/f2fs/f2fs.h |  8 ++++++++
 fs/f2fs/file.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
fs/f2fs/f2fs.h +8 -0
index 91db1d07f9f8..c27a6264d9bf 100644
@@ -303,6 +303,8 @@ static inline bool __has_cursum_space(struct f2fs_journal *journal,
 						struct f2fs_move_range)
 #define F2FS_IOC_FLUSH_DEVICE		_IOW(F2FS_IOCTL_MAGIC, 10,	\
 						struct f2fs_flush_device)
+#define F2FS_IOC_GARBAGE_COLLECT_RANGE	_IOW(F2FS_IOCTL_MAGIC, 11,	\
+						struct f2fs_gc_range)
 
 #define F2FS_IOC_SET_ENCRYPTION_POLICY	FS_IOC_SET_ENCRYPTION_POLICY
 #define F2FS_IOC_GET_ENCRYPTION_POLICY	FS_IOC_GET_ENCRYPTION_POLICY
@@ -327,6 +329,12 @@ static inline bool __has_cursum_space(struct f2fs_journal *journal,
 #define F2FS_IOC32_GETVERSION		FS_IOC32_GETVERSION
 #endif
 
+struct f2fs_gc_range {
+	u32 sync;
+	u64 start;
+	u64 len;
+};
+
 struct f2fs_defragment {
 	u64 start;
 	u64 len;
fs/f2fs/file.c +47 -0

65 lines not on this page · raw message

Signature · 1 line
2.13.0.rc1.294.g07d810a77f-goog