summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2019-06-26 18:23:05 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2019-07-12 18:35:04 -0700
commit427cc7cb30a14c2569190cae4b93f91828795229 (patch)
tree9c52ca8cbbf2b5df128a754144bfd6e6a46130bb /fs/f2fs
parent4b56b2d6d8622743b6ed452a324c95a8e69d5bf8 (diff)
f2fs: allocate blocks for pinned file
This patch allows fallocate to allocate physical blocks for pinned file. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index aee2b7ea0ad2..dca0b4a45ec3 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1537,7 +1537,12 @@ static int expand_inode_data(struct inode *inode, loff_t offset,
if (off_end)
map.m_len++;
- err = f2fs_map_blocks(inode, &map, 1, F2FS_GET_BLOCK_PRE_AIO);
+ if (f2fs_is_pinned_file(inode))
+ map.m_seg_type = CURSEG_COLD_DATA;
+
+ err = f2fs_map_blocks(inode, &map, 1, (f2fs_is_pinned_file(inode) ?
+ F2FS_GET_BLOCK_PRE_DIO :
+ F2FS_GET_BLOCK_PRE_AIO));
if (err) {
pgoff_t last_off;