extents.c (16ba7e312045cd5d32fba0156312b4303f200787) | extents.c (9e52484c713321e84e8834803a44ca0a001376d2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com 4 * Written by Alex Tomas <alex@clusterfs.com> 5 * 6 * Architecture independence: 7 * Copyright (c) 2005, Bull S.A. 8 * Written by Pierre Peiffer <pierre.peiffer@bull.net> --- 4493 unchanged lines hidden (view full) --- 4502 offset + len > EXT4_I(inode)->i_disksize)) { 4503 new_size = offset + len; 4504 ret = inode_newsize_ok(inode, new_size); 4505 if (ret) 4506 goto out_mutex; 4507 } 4508 4509 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT; | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com 4 * Written by Alex Tomas <alex@clusterfs.com> 5 * 6 * Architecture independence: 7 * Copyright (c) 2005, Bull S.A. 8 * Written by Pierre Peiffer <pierre.peiffer@bull.net> --- 4493 unchanged lines hidden (view full) --- 4502 offset + len > EXT4_I(inode)->i_disksize)) { 4503 new_size = offset + len; 4504 ret = inode_newsize_ok(inode, new_size); 4505 if (ret) 4506 goto out_mutex; 4507 } 4508 4509 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT; |
4510 if (mode & FALLOC_FL_KEEP_SIZE) 4511 flags |= EXT4_GET_BLOCKS_KEEP_SIZE; | |
4512 4513 /* Wait all existing dio workers, newcomers will block on i_mutex */ 4514 inode_dio_wait(inode); 4515 4516 /* Preallocate the range including the unaligned edges */ 4517 if (partial_begin || partial_end) { 4518 ret = ext4_alloc_file_blocks(file, 4519 round_down(offset, 1 << blkbits) >> blkbits, --- 122 unchanged lines hidden (view full) --- 4642 if (mode & FALLOC_FL_ZERO_RANGE) 4643 return ext4_zero_range(file, offset, len, mode); 4644 4645 trace_ext4_fallocate_enter(inode, offset, len, mode); 4646 lblk = offset >> blkbits; 4647 4648 max_blocks = EXT4_MAX_BLOCKS(len, offset, blkbits); 4649 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT; | 4510 4511 /* Wait all existing dio workers, newcomers will block on i_mutex */ 4512 inode_dio_wait(inode); 4513 4514 /* Preallocate the range including the unaligned edges */ 4515 if (partial_begin || partial_end) { 4516 ret = ext4_alloc_file_blocks(file, 4517 round_down(offset, 1 << blkbits) >> blkbits, --- 122 unchanged lines hidden (view full) --- 4640 if (mode & FALLOC_FL_ZERO_RANGE) 4641 return ext4_zero_range(file, offset, len, mode); 4642 4643 trace_ext4_fallocate_enter(inode, offset, len, mode); 4644 lblk = offset >> blkbits; 4645 4646 max_blocks = EXT4_MAX_BLOCKS(len, offset, blkbits); 4647 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT; |
4650 if (mode & FALLOC_FL_KEEP_SIZE) 4651 flags |= EXT4_GET_BLOCKS_KEEP_SIZE; | |
4652 4653 inode_lock(inode); 4654 4655 /* 4656 * We only support preallocation for extent-based files only 4657 */ 4658 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) { 4659 ret = -EOPNOTSUPP; --- 1076 unchanged lines hidden --- | 4648 4649 inode_lock(inode); 4650 4651 /* 4652 * We only support preallocation for extent-based files only 4653 */ 4654 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) { 4655 ret = -EOPNOTSUPP; --- 1076 unchanged lines hidden --- |