]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: return the converted extent in __xfs_reflink_convert_cow
authorChristoph Hellwig <hch@lst.de>
Mon, 6 Feb 2017 18:46:01 +0000 (10:46 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 7 Feb 2017 01:47:46 +0000 (17:47 -0800)
We'll need it for the direct I/O code.  Also rename the function to
xfs_reflink_convert_cow_extent to describe it a bit better.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_reflink.c

index 8c8c4f4676da4e70d829dabf735cac7086308c59..219bc96bfc711e186a07d5d233fe229a66b2c033 100644 (file)
@@ -332,20 +332,19 @@ xfs_reflink_convert_cow_extent(
        xfs_filblks_t                   count_fsb,
        struct xfs_defer_ops            *dfops)
 {
-       struct xfs_bmbt_irec            irec = *imap;
        xfs_fsblock_t                   first_block;
        int                             nimaps = 1;
 
        if (imap->br_state == XFS_EXT_NORM)
                return 0;
 
-       xfs_trim_extent(&irec, offset_fsb, count_fsb);
-       trace_xfs_reflink_convert_cow(ip, &irec);
-       if (irec.br_blockcount == 0)
+       xfs_trim_extent(imap, offset_fsb, count_fsb);
+       trace_xfs_reflink_convert_cow(ip, imap);
+       if (imap->br_blockcount == 0)
                return 0;
-       return xfs_bmapi_write(NULL, ip, irec.br_startoff, irec.br_blockcount,
+       return xfs_bmapi_write(NULL, ip, imap->br_startoff, imap->br_blockcount,
                        XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT, &first_block,
-                       0, &irec, &nimaps, dfops);
+                       0, imap, &nimaps, dfops);
 }
 
 /* Convert all of the unwritten CoW extents in a file's range to real ones. */