f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS
PATCH v2 1/1 f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS
This patch introduces a new ioctl to rollback all compress inode status:
- add reserved blocks in dnode blocks
- increase i_compr_blocks, i_blocks, total_valid_block_count
- remove immutable flag
Then compress inode can be restored to support overwrite functionality again.
Signee-off-by Chao Yu <[email protected]>
---
v2:
fix to align parameter @count to cluster size.
fs/f2fs/f2fs.h | 2 + fs/f2fs/file.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+)
fs/f2fs/f2fs.h +2 -0
@@ -429,6 +429,8 @@ static inline bool __has_cursum_space(struct f2fs_journal *journal,#define F2FS_IOC_GET_COMPRESS_BLOCKS _IOR(F2FS_IOCTL_MAGIC, 17, __u64)#define F2FS_IOC_RELEASE_COMPRESS_BLOCKS \ _IOR(F2FS_IOCTL_MAGIC, 18, __u64) +#define F2FS_IOC_RESERVE_COMPRESS_BLOCKS \ + _IOR(F2FS_IOCTL_MAGIC, 19, __u64)#define F2FS_IOC_GET_VOLUME_NAME FS_IOC_GETFSLABEL#define F2FS_IOC_SET_VOLUME_NAME FS_IOC_SETFSLABEL
fs/f2fs/file.c +162 -0
180 lines not on this page · raw message
Signature · 1 line
2.18.0.rc1