diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-06-26 18:23:05 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-07-02 15:40:42 -0700 |
commit | cad3836f9eb292647c9e3e5c6c778e6fa6e6bf15 (patch) | |
tree | d2dfb3cfe303ed1bb3f4d834d964e6a60872cfad /fs/f2fs | |
parent | 56659ce838456c6f2315ce8a4bd686ac4b23e9d1 (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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c67ff5057472..b164f48e0f31 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1528,7 +1528,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; |