aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode_fork.c')
-rw-r--r--fs/xfs/xfs_inode_fork.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/xfs/xfs_inode_fork.c b/fs/xfs/xfs_inode_fork.c
index cfee14a83cfe..73514c0486b7 100644
--- a/fs/xfs/xfs_inode_fork.c
+++ b/fs/xfs/xfs_inode_fork.c
@@ -431,6 +431,8 @@ xfs_iread_extents(
431 xfs_ifork_t *ifp; 431 xfs_ifork_t *ifp;
432 xfs_extnum_t nextents; 432 xfs_extnum_t nextents;
433 433
434 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
435
434 if (unlikely(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) { 436 if (unlikely(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) {
435 XFS_ERROR_REPORT("xfs_iread_extents", XFS_ERRLEVEL_LOW, 437 XFS_ERROR_REPORT("xfs_iread_extents", XFS_ERRLEVEL_LOW,
436 ip->i_mount); 438 ip->i_mount);
@@ -721,15 +723,16 @@ xfs_idestroy_fork(
721} 723}
722 724
723/* 725/*
724 * xfs_iextents_copy() 726 * Convert in-core extents to on-disk form
725 * 727 *
726 * This is called to copy the REAL extents (as opposed to the delayed 728 * For either the data or attr fork in extent format, we need to endian convert
727 * allocation extents) from the inode into the given buffer. It 729 * the in-core extent as we place them into the on-disk inode.
728 * returns the number of bytes copied into the buffer.
729 * 730 *
730 * If there are no delayed allocation extents, then we can just 731 * In the case of the data fork, the in-core and on-disk fork sizes can be
731 * memcpy() the extents into the buffer. Otherwise, we need to 732 * different due to delayed allocation extents. We only copy on-disk extents
732 * examine each extent in turn and skip those which are delayed. 733 * here, so callers must always use the physical fork size to determine the
734 * size of the buffer passed to this routine. We will return the size actually
735 * used.
733 */ 736 */
734int 737int
735xfs_iextents_copy( 738xfs_iextents_copy(