f2fs: support FALLOC_FL_INSERT_RANGE
authorChao Yu <chao2.yu@samsung.com>
Thu, 28 May 2015 11:16:57 +0000 (19:16 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 2 Jun 2015 16:53:27 +0000 (09:53 -0700)
commitf62185d0e283e9d311e3ac1020f159d95f0aab39
treef1e56b52a9e770dac6cb1ecfedb5845b5c58b247
parent528e34593d6eff11a289ef23452c66175a340f0b
f2fs: support FALLOC_FL_INSERT_RANGE

FALLOC_FL_INSERT_RANGE flag for ->fallocate was introduced in commit
dd46c787788d ("fs: Add support FALLOC_FL_INSERT_RANGE for fallocate").

The effect of FALLOC_FL_INSERT_RANGE command is the opposite of
FALLOC_FL_COLLAPSE_RANGE, if this command was performed, all data from
offset to EOF in our file will be shifted to right as given length, and
then range [offset, offset + length] becomes a hole.

This command is useful for our user who wants to add some data in the
middle of the file, for example: video/music editor will insert a keyframe
in specified position of media file, with this command we can easily create
a hole for inserting without removing original data.

This patch introduces f2fs_insert_range() to support FALLOC_FL_INSERT_RANGE.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Yuan Zhong <yuan.mark.zhong@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c
This page took 0.031222 seconds and 5 git commands to generate.