]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: change return value of xfs_inode_need_cow to int
authorzhengbin <zhengbin13@huawei.com>
Mon, 20 Jan 2020 22:34:47 +0000 (14:34 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 20 Jan 2020 22:34:47 +0000 (14:34 -0800)
Fixes coccicheck warning:

fs/xfs/xfs_reflink.c:236:9-10: WARNING: return of 0/1 in function 'xfs_inode_need_cow' with return type bool

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
[darrick: rename the function so it doesn't sound like a predicate]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_iomap.c
fs/xfs/xfs_reflink.c
fs/xfs/xfs_reflink.h

index 28e2d1f37267d49d6abd8e5faa07f5401c856e64..bb590a267a7f92a2a8ebf43592fd9aec4ca3e81f 100644 (file)
@@ -923,7 +923,7 @@ xfs_buffered_write_iomap_begin(
                xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
 
                /* Trim the mapping to the nearest shared extent boundary. */
-               error = xfs_inode_need_cow(ip, &imap, &shared);
+               error = xfs_bmap_trim_cow(ip, &imap, &shared);
                if (error)
                        goto out_unlock;
 
index 7a6c94295b8acc952b6b2179863071ad1833035e..e723b267a24789e1fc3c49edf559b7667c838e61 100644 (file)
@@ -223,8 +223,8 @@ xfs_reflink_trim_around_shared(
        }
 }
 
-bool
-xfs_inode_need_cow(
+int
+xfs_bmap_trim_cow(
        struct xfs_inode        *ip,
        struct xfs_bmbt_irec    *imap,
        bool                    *shared)
@@ -327,7 +327,7 @@ xfs_find_trim_cow_extent(
        if (cmap->br_startoff > offset_fsb) {
                xfs_trim_extent(imap, imap->br_startoff,
                                cmap->br_startoff - imap->br_startoff);
-               return xfs_inode_need_cow(ip, imap, shared);
+               return xfs_bmap_trim_cow(ip, imap, shared);
        }
 
        *shared = true;
index d18ad7f4fb64b02360d81d0c6499992cc4d0e71f..3e4fd46373abe3fe865071272f876252ace00d8d 100644 (file)
@@ -22,7 +22,7 @@ extern int xfs_reflink_find_shared(struct xfs_mount *mp, struct xfs_trans *tp,
                xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal);
 extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
                struct xfs_bmbt_irec *irec, bool *shared);
-bool xfs_inode_need_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,
+int xfs_bmap_trim_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,
                bool *shared);
 
 int xfs_reflink_allocate_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,