extents.c (1d39834fba99c48edd3d4887ccd474da61a1ada7) | extents.c (dcae058a8da9c3cfc0055c7937ccd1a3dd0382a8) |
---|---|
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> --- 5728 unchanged lines hidden (view full) --- 5737/** 5738 * ext4_swap_extents - Swap extents between two inodes 5739 * 5740 * @inode1: First inode 5741 * @inode2: Second inode 5742 * @lblk1: Start block for first inode 5743 * @lblk2: Start block for second inode 5744 * @count: Number of blocks to swap | 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> --- 5728 unchanged lines hidden (view full) --- 5737/** 5738 * ext4_swap_extents - Swap extents between two inodes 5739 * 5740 * @inode1: First inode 5741 * @inode2: Second inode 5742 * @lblk1: Start block for first inode 5743 * @lblk2: Start block for second inode 5744 * @count: Number of blocks to swap |
5745 * @mark_unwritten: Mark second inode's extents as unwritten after swap | 5745 * @unwritten: Mark second inode's extents as unwritten after swap |
5746 * @erp: Pointer to save error value 5747 * 5748 * This helper routine does exactly what is promise "swap extents". All other 5749 * stuff such as page-cache locking consistency, bh mapping consistency or 5750 * extent's data copying must be performed by caller. 5751 * Locking: 5752 * i_mutex is held for both inodes 5753 * i_data_sem is locked for write for both inodes 5754 * Assumptions: 5755 * All pages from requested range are locked for both inodes 5756 */ 5757int 5758ext4_swap_extents(handle_t *handle, struct inode *inode1, | 5746 * @erp: Pointer to save error value 5747 * 5748 * This helper routine does exactly what is promise "swap extents". All other 5749 * stuff such as page-cache locking consistency, bh mapping consistency or 5750 * extent's data copying must be performed by caller. 5751 * Locking: 5752 * i_mutex is held for both inodes 5753 * i_data_sem is locked for write for both inodes 5754 * Assumptions: 5755 * All pages from requested range are locked for both inodes 5756 */ 5757int 5758ext4_swap_extents(handle_t *handle, struct inode *inode1, |
5759 struct inode *inode2, ext4_lblk_t lblk1, ext4_lblk_t lblk2, | 5759 struct inode *inode2, ext4_lblk_t lblk1, ext4_lblk_t lblk2, |
5760 ext4_lblk_t count, int unwritten, int *erp) 5761{ 5762 struct ext4_ext_path *path1 = NULL; 5763 struct ext4_ext_path *path2 = NULL; 5764 int replaced_count = 0; 5765 5766 BUG_ON(!rwsem_is_locked(&EXT4_I(inode1)->i_data_sem)); 5767 BUG_ON(!rwsem_is_locked(&EXT4_I(inode2)->i_data_sem)); --- 164 unchanged lines hidden --- | 5760 ext4_lblk_t count, int unwritten, int *erp) 5761{ 5762 struct ext4_ext_path *path1 = NULL; 5763 struct ext4_ext_path *path2 = NULL; 5764 int replaced_count = 0; 5765 5766 BUG_ON(!rwsem_is_locked(&EXT4_I(inode1)->i_data_sem)); 5767 BUG_ON(!rwsem_is_locked(&EXT4_I(inode2)->i_data_sem)); --- 164 unchanged lines hidden --- |