Commit aa124436 authored by zhengbin's avatar zhengbin Committed by Darrick J. Wong

xfs: change return value of xfs_inode_need_cow to int

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarzhengbin <zhengbin13@huawei.com>
[darrick: rename the function so it doesn't sound like a predicate]
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 8a6453a8
...@@ -923,7 +923,7 @@ xfs_buffered_write_iomap_begin( ...@@ -923,7 +923,7 @@ xfs_buffered_write_iomap_begin(
xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb); xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
/* Trim the mapping to the nearest shared extent boundary. */ /* 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) if (error)
goto out_unlock; goto out_unlock;
......
...@@ -223,8 +223,8 @@ xfs_reflink_trim_around_shared( ...@@ -223,8 +223,8 @@ xfs_reflink_trim_around_shared(
} }
} }
bool int
xfs_inode_need_cow( xfs_bmap_trim_cow(
struct xfs_inode *ip, struct xfs_inode *ip,
struct xfs_bmbt_irec *imap, struct xfs_bmbt_irec *imap,
bool *shared) bool *shared)
...@@ -327,7 +327,7 @@ xfs_find_trim_cow_extent( ...@@ -327,7 +327,7 @@ xfs_find_trim_cow_extent(
if (cmap->br_startoff > offset_fsb) { if (cmap->br_startoff > offset_fsb) {
xfs_trim_extent(imap, imap->br_startoff, xfs_trim_extent(imap, imap->br_startoff,
cmap->br_startoff - 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; *shared = true;
......
...@@ -22,7 +22,7 @@ extern int xfs_reflink_find_shared(struct xfs_mount *mp, struct xfs_trans *tp, ...@@ -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); xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal);
extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip, extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
struct xfs_bmbt_irec *irec, bool *shared); 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); bool *shared);
int xfs_reflink_allocate_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap, int xfs_reflink_allocate_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment