Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d99831ff authored by Eric Sandeen's avatar Eric Sandeen Committed by Dave Chinner
Browse files

xfs: return is not a function



return is not a function.  "return(EIO);" is silly;
"return (EIO);" moreso.  return is not a function.
Nuke the pointless parens.

[dchinner: catch a couple of extra cases in xfs_attr_list.c,
xfs_acl.c and xfs_linux.h.]

Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent a497c3ba
Loading
Loading
Loading
Loading
+23 −23
Original line number Diff line number Diff line
@@ -535,27 +535,27 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)

	retval = xfs_attr_shortform_lookup(args);
	if ((args->flags & ATTR_REPLACE) && (retval == ENOATTR)) {
		return(retval);
		return retval;
	} else if (retval == EEXIST) {
		if (args->flags & ATTR_CREATE)
			return(retval);
			return retval;
		retval = xfs_attr_shortform_remove(args);
		ASSERT(retval == 0);
	}

	if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX ||
	    args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX)
		return(XFS_ERROR(ENOSPC));
		return XFS_ERROR(ENOSPC);

	newsize = XFS_ATTR_SF_TOTSIZE(args->dp);
	newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen);

	forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize);
	if (!forkoff)
		return(XFS_ERROR(ENOSPC));
		return XFS_ERROR(ENOSPC);

	xfs_attr_shortform_add(args, forkoff);
	return(0);
	return 0;
}


@@ -642,7 +642,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
			ASSERT(committed);
			args->trans = NULL;
			xfs_bmap_cancel(args->flist);
			return(error);
			return error;
		}

		/*
@@ -658,13 +658,13 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
		 */
		error = xfs_trans_roll(&args->trans, dp);
		if (error)
			return (error);
			return error;

		/*
		 * Fob the whole rest of the problem off on the Btree code.
		 */
		error = xfs_attr_node_addname(args);
		return(error);
		return error;
	}

	/*
@@ -673,7 +673,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
	 */
	error = xfs_trans_roll(&args->trans, dp);
	if (error)
		return (error);
		return error;

	/*
	 * If there was an out-of-line value, allocate the blocks we
@@ -684,7 +684,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
	if (args->rmtblkno > 0) {
		error = xfs_attr_rmtval_set(args);
		if (error)
			return(error);
			return error;
	}

	/*
@@ -700,7 +700,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
		 */
		error = xfs_attr3_leaf_flipflags(args);
		if (error)
			return(error);
			return error;

		/*
		 * Dismantle the "old" attribute/value pair by removing
@@ -714,7 +714,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
		if (args->rmtblkno) {
			error = xfs_attr_rmtval_remove(args);
			if (error)
				return(error);
				return error;
		}

		/*
@@ -744,7 +744,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
				ASSERT(committed);
				args->trans = NULL;
				xfs_bmap_cancel(args->flist);
				return(error);
				return error;
			}

			/*
@@ -1031,7 +1031,7 @@ restart:
	if (args->rmtblkno > 0) {
		error = xfs_attr_rmtval_set(args);
		if (error)
			return(error);
			return error;
	}

	/*
@@ -1061,7 +1061,7 @@ restart:
		if (args->rmtblkno) {
			error = xfs_attr_rmtval_remove(args);
			if (error)
				return(error);
				return error;
		}

		/*
@@ -1134,8 +1134,8 @@ out:
	if (state)
		xfs_da_state_free(state);
	if (error)
		return(error);
	return(retval);
		return error;
	return retval;
}

/*
@@ -1297,7 +1297,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)

out:
	xfs_da_state_free(state);
	return(error);
	return error;
}

/*
@@ -1345,7 +1345,7 @@ xfs_attr_fillstate(xfs_da_state_t *state)
		}
	}

	return(0);
	return 0;
}

/*
@@ -1376,7 +1376,7 @@ xfs_attr_refillstate(xfs_da_state_t *state)
						blk->blkno, blk->disk_blkno,
						&blk->bp, XFS_ATTR_FORK);
			if (error)
				return(error);
				return error;
		} else {
			blk->bp = NULL;
		}
@@ -1395,13 +1395,13 @@ xfs_attr_refillstate(xfs_da_state_t *state)
						blk->blkno, blk->disk_blkno,
						&blk->bp, XFS_ATTR_FORK);
			if (error)
				return(error);
				return error;
		} else {
			blk->bp = NULL;
		}
	}

	return(0);
	return 0;
}

/*
@@ -1455,5 +1455,5 @@ xfs_attr_node_get(xfs_da_args_t *args)
	}

	xfs_da_state_free(state);
	return(retval);
	return retval;
}
+7 −7
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ xfs_attr3_leaf_freextent(
		error = xfs_bmapi_read(dp, (xfs_fileoff_t)tblkno, tblkcnt,
				       &map, &nmap, XFS_BMAPI_ATTRFORK);
		if (error) {
			return(error);
			return error;
		}
		ASSERT(nmap == 1);
		ASSERT(map.br_startblock != DELAYSTARTBLOCK);
@@ -102,14 +102,14 @@ xfs_attr3_leaf_freextent(
			 */
			error = xfs_trans_roll(trans, dp);
			if (error)
				return (error);
				return error;
		}

		tblkno += map.br_blockcount;
		tblkcnt -= map.br_blockcount;
	}

	return(0);
	return 0;
}

/*
@@ -256,7 +256,7 @@ xfs_attr3_node_inactive(
		error = xfs_da3_node_read(*trans, dp, child_fsb, -2, &child_bp,
						XFS_ATTR_FORK);
		if (error)
			return(error);
			return error;
		if (child_bp) {
						/* save for re-read later */
			child_blkno = XFS_BUF_ADDR(child_bp);
@@ -414,7 +414,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
	error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0);
	if (error) {
		xfs_trans_cancel(trans, 0);
		return(error);
		return error;
	}
	xfs_ilock(dp, XFS_ILOCK_EXCL);

@@ -443,10 +443,10 @@ xfs_attr_inactive(xfs_inode_t *dp)
	error = xfs_trans_commit(trans, XFS_TRANS_RELEASE_LOG_RES);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);

	return(error);
	return error;

out:
	xfs_trans_cancel(trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);
	return(error);
	return error;
}
+24 −24
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
		break;
	}
	if (i == end)
		return(XFS_ERROR(ENOATTR));
		return XFS_ERROR(ENOATTR);

	/*
	 * Fix up the attribute fork data, covering the hole
@@ -582,7 +582,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)

	xfs_sbversion_add_attr2(mp, args->trans);

	return(0);
	return 0;
}

/*
@@ -611,9 +611,9 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args)
			continue;
		if (!xfs_attr_namesp_match(args->flags, sfe->flags))
			continue;
		return(XFS_ERROR(EEXIST));
		return XFS_ERROR(EEXIST);
	}
	return(XFS_ERROR(ENOATTR));
	return XFS_ERROR(ENOATTR);
}

/*
@@ -640,18 +640,18 @@ xfs_attr_shortform_getvalue(xfs_da_args_t *args)
			continue;
		if (args->flags & ATTR_KERNOVAL) {
			args->valuelen = sfe->valuelen;
			return(XFS_ERROR(EEXIST));
			return XFS_ERROR(EEXIST);
		}
		if (args->valuelen < sfe->valuelen) {
			args->valuelen = sfe->valuelen;
			return(XFS_ERROR(ERANGE));
			return XFS_ERROR(ERANGE);
		}
		args->valuelen = sfe->valuelen;
		memcpy(args->value, &sfe->nameval[args->namelen],
						    args->valuelen);
		return(XFS_ERROR(EEXIST));
		return XFS_ERROR(EEXIST);
	}
	return(XFS_ERROR(ENOATTR));
	return XFS_ERROR(ENOATTR);
}

/*
@@ -741,7 +741,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)

out:
	kmem_free(tmpbuffer);
	return(error);
	return error;
}

/*
@@ -769,12 +769,12 @@ xfs_attr_shortform_allfit(
		if (entry->flags & XFS_ATTR_INCOMPLETE)
			continue;		/* don't copy partial entries */
		if (!(entry->flags & XFS_ATTR_LOCAL))
			return(0);
			return 0;
		name_loc = xfs_attr3_leaf_name_local(leaf, i);
		if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX)
			return(0);
			return 0;
		if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX)
			return(0);
			return 0;
		bytes += sizeof(struct xfs_attr_sf_entry) - 1
				+ name_loc->namelen
				+ be16_to_cpu(name_loc->valuelen);
@@ -1017,10 +1017,10 @@ xfs_attr3_leaf_split(
	ASSERT(oldblk->magic == XFS_ATTR_LEAF_MAGIC);
	error = xfs_da_grow_inode(state->args, &blkno);
	if (error)
		return(error);
		return error;
	error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp);
	if (error)
		return(error);
		return error;
	newblk->blkno = blkno;
	newblk->magic = XFS_ATTR_LEAF_MAGIC;

@@ -1031,7 +1031,7 @@ xfs_attr3_leaf_split(
	xfs_attr3_leaf_rebalance(state, oldblk, newblk);
	error = xfs_da3_blk_link(state, oldblk, newblk);
	if (error)
		return(error);
		return error;

	/*
	 * Save info on "old" attribute for "atomic rename" ops, leaf_add()
@@ -1053,7 +1053,7 @@ xfs_attr3_leaf_split(
	 */
	oldblk->hashval = xfs_attr_leaf_lasthash(oldblk->bp, NULL);
	newblk->hashval = xfs_attr_leaf_lasthash(newblk->bp, NULL);
	return(error);
	return error;
}

/*
@@ -1692,7 +1692,7 @@ xfs_attr3_leaf_toosmall(
		ichdr.usedbytes;
	if (bytes > (state->args->geo->blksize >> 1)) {
		*action = 0;	/* blk over 50%, don't try to join */
		return(0);
		return 0;
	}

	/*
@@ -1711,7 +1711,7 @@ xfs_attr3_leaf_toosmall(
		error = xfs_da3_path_shift(state, &state->altpath, forward,
						 0, &retval);
		if (error)
			return(error);
			return error;
		if (retval) {
			*action = 0;
		} else {
@@ -1740,7 +1740,7 @@ xfs_attr3_leaf_toosmall(
		error = xfs_attr3_leaf_read(state->args->trans, state->args->dp,
					blkno, -1, &bp);
		if (error)
			return(error);
			return error;

		xfs_attr3_leaf_hdr_from_disk(&ichdr2, bp->b_addr);

@@ -1757,7 +1757,7 @@ xfs_attr3_leaf_toosmall(
	}
	if (i >= 2) {
		*action = 0;
		return(0);
		return 0;
	}

	/*
@@ -1773,13 +1773,13 @@ xfs_attr3_leaf_toosmall(
						 0, &retval);
	}
	if (error)
		return(error);
		return error;
	if (retval) {
		*action = 0;
	} else {
		*action = 1;
	}
	return(0);
	return 0;
}

/*
@@ -2481,7 +2481,7 @@ xfs_attr3_leaf_clearflag(
	 */
	error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp);
	if (error)
		return(error);
		return error;

	leaf = bp->b_addr;
	entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
@@ -2548,7 +2548,7 @@ xfs_attr3_leaf_setflag(
	 */
	error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp);
	if (error)
		return(error);
		return error;

	leaf = bp->b_addr;
#ifdef DEBUG
+10 −10
Original line number Diff line number Diff line
@@ -50,11 +50,11 @@ xfs_attr_shortform_compare(const void *a, const void *b)
	sa = (xfs_attr_sf_sort_t *)a;
	sb = (xfs_attr_sf_sort_t *)b;
	if (sa->hash < sb->hash) {
		return(-1);
		return -1;
	} else if (sa->hash > sb->hash) {
		return(1);
		return 1;
	} else {
		return(sa->entno - sb->entno);
		return sa->entno - sb->entno;
	}
}

@@ -86,7 +86,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
	sf = (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data;
	ASSERT(sf != NULL);
	if (!sf->hdr.count)
		return(0);
		return 0;
	cursor = context->cursor;
	ASSERT(cursor != NULL);

@@ -124,7 +124,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
			sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
		}
		trace_xfs_attr_list_sf_all(context);
		return(0);
		return 0;
	}

	/* do no more for a search callback */
@@ -188,7 +188,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
	}
	if (i == nsbuf) {
		kmem_free(sbuf);
		return(0);
		return 0;
	}

	/*
@@ -213,7 +213,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
	}

	kmem_free(sbuf);
	return(0);
	return 0;
}

STATIC int
@@ -244,7 +244,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
		error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1,
					      &bp, XFS_ATTR_FORK);
		if ((error != 0) && (error != EFSCORRUPTED))
			return(error);
			return error;
		if (bp) {
			struct xfs_attr_leaf_entry *entries;

@@ -295,7 +295,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
						      cursor->blkno, -1, &bp,
						      XFS_ATTR_FORK);
			if (error)
				return(error);
				return error;
			node = bp->b_addr;
			magic = be16_to_cpu(node->hdr.info.magic);
			if (magic == XFS_ATTR_LEAF_MAGIC ||
@@ -616,7 +616,7 @@ xfs_attr_list(
	 * Validate the cursor.
	 */
	if (cursor->pad1 || cursor->pad2)
		return(XFS_ERROR(EINVAL));
		return XFS_ERROR(EINVAL);
	if ((cursor->initted == 0) &&
	    (cursor->hashval || cursor->blkno || cursor->offset))
		return XFS_ERROR(EINVAL);
+6 −6
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ xfs_attr_rmtval_set(
			ASSERT(committed);
			args->trans = NULL;
			xfs_bmap_cancel(args->flist);
			return(error);
			return error;
		}

		/*
@@ -473,7 +473,7 @@ xfs_attr_rmtval_set(
		 */
		error = xfs_trans_roll(&args->trans, dp);
		if (error)
			return (error);
			return error;
	}

	/*
@@ -498,7 +498,7 @@ xfs_attr_rmtval_set(
				       blkcnt, &map, &nmap,
				       XFS_BMAPI_ATTRFORK);
		if (error)
			return(error);
			return error;
		ASSERT(nmap == 1);
		ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
		       (map.br_startblock != HOLESTARTBLOCK));
@@ -563,7 +563,7 @@ xfs_attr_rmtval_remove(
		error = xfs_bmapi_read(args->dp, (xfs_fileoff_t)lblkno,
				       blkcnt, &map, &nmap, XFS_BMAPI_ATTRFORK);
		if (error)
			return(error);
			return error;
		ASSERT(nmap == 1);
		ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
		       (map.br_startblock != HOLESTARTBLOCK));
@@ -622,7 +622,7 @@ xfs_attr_rmtval_remove(
		 */
		error = xfs_trans_roll(&args->trans, args->dp);
		if (error)
			return (error);
			return error;
	}
	return(0);
	return 0;
}
Loading