public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] do not test return value of xfs_bmap_*_count_leaves
@ 2008-03-28 15:43 Ruben Porras
  2008-03-28 15:46 ` Josef 'Jeff' Sipek
  0 siblings, 1 reply; 3+ messages in thread
From: Ruben Porras @ 2008-03-28 15:43 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

These functions, xfs_bmap_count_leaves and xfs_bmap_disk_count_leaves,
return always 0. Therefore it is not necessary to test the return value.

Regards

[-- Attachment #2: xfs_bmap.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

Index: fs/xfs/xfs_bmap.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_bmap.c,v
retrieving revision 1.383
diff -u -r1.383 xfs_bmap.c
--- fs/xfs/xfs_bmap.c	6 Feb 2008 05:18:18 -0000	1.383
+++ fs/xfs/xfs_bmap.c	28 Mar 2008 15:39:59 -0000
@@ -6361,13 +6361,9 @@
 	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;
 	}
 
@@ -6448,13 +6444,7 @@
 		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;

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 15:43 [PATCH] do not test return value of xfs_bmap_*_count_leaves Ruben Porras
2008-03-28 15:46 ` Josef 'Jeff' Sipek
2008-04-04 15:08   ` Ruben Porras

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