public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PING] do not test return value of xfs_bmap_*_count_leaves
@ 2008-07-28 21:39 Ruben Porras
  2008-08-04  3:01 ` Donald Douwsma
  0 siblings, 1 reply; 2+ messages in thread
From: Ruben Porras @ 2008-07-28 21:39 UTC (permalink / raw)
  To: xfs

http://oss.sgi.com/archives/xfs/2008-04/msg00087.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PING] do not test return value of xfs_bmap_*_count_leaves
  2008-07-28 21:39 [PING] do not test return value of xfs_bmap_*_count_leaves Ruben Porras
@ 2008-08-04  3:01 ` Donald Douwsma
  0 siblings, 0 replies; 2+ messages in thread
From: Donald Douwsma @ 2008-08-04  3:01 UTC (permalink / raw)
  To: Ruben Porras; +Cc: xfs

Ruben Porras wrote:
> http://oss.sgi.com/archives/xfs/2008-04/msg00087.html
> 

Got it, sorry we dropped it for so long.

Your second patch missed the int/void decleration changes, I've added
that to the patch. I'm also assuming the following Signed-off-by and
description, is that ok by you?


Make xfs_bmap_*_count_leaves void.

xfs_bmap_count_leaves and xfs_bmap_disk_count_leaves always
return always 0, make them void.

Signed-off-by: "Ruben Porras <nahoo82@gmail.com>"


--- fs/xfs/xfs_bmap.c.orig
+++ fs/xfs/xfs_bmap.c
@@ -384,14 +384,14 @@ xfs_bmap_count_tree(
  	int             levelin,
  	int		*count);

-STATIC int
+STATIC void
  xfs_bmap_count_leaves(
  	xfs_ifork_t		*ifp,
  	xfs_extnum_t		idx,
  	int			numrecs,
  	int			*count);

-STATIC int
+STATIC void
  xfs_bmap_disk_count_leaves(
  	xfs_extnum_t		idx,
  	xfs_bmbt_block_t	*block,
@@ -6367,13 +6367,9 @@ xfs_bmap_count_blocks(
  	mp = ip->i_mount;
  	ifp = XFS_IFORK_PTR(ip, whichfork);
  	if ( XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS ) {
-		if (unlikely(xfs_bmap_count_leaves(ifp, 0,
+		xfs_bmap_count_leaves(ifp, 0,
  			ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t),
-			count) < 0)) {
-			XFS_ERROR_REPORT("xfs_bmap_count_blocks(1)",
-					 XFS_ERRLEVEL_LOW, mp);
-			return XFS_ERROR(EFSCORRUPTED);
-		}
+			count);
  		return 0;
  	}

@@ -6454,13 +6450,7 @@ xfs_bmap_count_tree(
  		for (;;) {
  			nextbno = be64_to_cpu(block->bb_rightsib);
  			numrecs = be16_to_cpu(block->bb_numrecs);
-			if (unlikely(xfs_bmap_disk_count_leaves(0,
-					block, numrecs, count) < 0)) {
-				xfs_trans_brelse(tp, bp);
-				XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
-						 XFS_ERRLEVEL_LOW, mp);
-				return XFS_ERROR(EFSCORRUPTED);
-			}
+			xfs_bmap_disk_count_leaves(0, block, numrecs, count);
  			xfs_trans_brelse(tp, bp);
  			if (nextbno == NULLFSBLOCK)
  				break;
@@ -6478,7 +6468,7 @@ xfs_bmap_count_tree(
  /*
   * Count leaf blocks given a range of extent records.
   */
-STATIC int
+STATIC void
  xfs_bmap_count_leaves(
  	xfs_ifork_t		*ifp,
  	xfs_extnum_t		idx,
@@ -6491,14 +6481,13 @@ xfs_bmap_count_leaves(
  		xfs_bmbt_rec_host_t *frp = xfs_iext_get_ext(ifp, idx + b);
  		*count += xfs_bmbt_get_blockcount(frp);
  	}
-	return 0;
  }

  /*
   * Count leaf blocks given a range of extent records originally
   * in btree format.
   */
-STATIC int
+STATIC void
  xfs_bmap_disk_count_leaves(
  	xfs_extnum_t		idx,
  	xfs_bmbt_block_t	*block,
@@ -6512,5 +6501,4 @@ xfs_bmap_disk_count_leaves(
  		frp = XFS_BTREE_REC_ADDR(xfs_bmbt, block, idx + b);
  		*count += xfs_bmbt_disk_get_blockcount(frp);
  	}
-	return 0;
  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-04  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-28 21:39 [PING] do not test return value of xfs_bmap_*_count_leaves Ruben Porras
2008-08-04  3:01 ` Donald Douwsma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox