diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-25 00:58:08 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-25 00:58:08 -0400 |
commit | 2451337dd043901b5270b7586942abe564443e3d (patch) | |
tree | 5f2a59b2c829dbb942c18315ffc0edfed0d3790a /fs/xfs/libxfs/xfs_dir2_sf.c | |
parent | 30f712c9dd69348aa51351d5cb6d366bf4fae31d (diff) |
xfs: global error sign conversion
Convert all the errors the core XFs code to negative error signs
like the rest of the kernel and remove all the sign conversion we
do in the interface layers.
Errors for conversion (and comparison) found via searches like:
$ git grep " E" fs/xfs
$ git grep "return E" fs/xfs
$ git grep " E[A-Z].*;$" fs/xfs
Negation points found via searches like:
$ git grep "= -[a-z,A-Z]" fs/xfs
$ git grep "return -[a-z,A-D,F-Z]" fs/xfs
$ git grep " -[a-z].*;" fs/xfs
[ with some bits I missed from Brian Foster ]
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_sf.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_sf.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c index ab3563b87995..8f4f26af35e1 100644 --- a/fs/xfs/libxfs/xfs_dir2_sf.c +++ b/fs/xfs/libxfs/xfs_dir2_sf.c | |||
@@ -251,7 +251,7 @@ xfs_dir2_block_to_sf( | |||
251 | logflags = XFS_ILOG_CORE; | 251 | logflags = XFS_ILOG_CORE; |
252 | error = xfs_dir2_shrink_inode(args, args->geo->datablk, bp); | 252 | error = xfs_dir2_shrink_inode(args, args->geo->datablk, bp); |
253 | if (error) { | 253 | if (error) { |
254 | ASSERT(error != ENOSPC); | 254 | ASSERT(error != -ENOSPC); |
255 | goto out; | 255 | goto out; |
256 | } | 256 | } |
257 | 257 | ||
@@ -299,7 +299,7 @@ xfs_dir2_sf_addname( | |||
299 | 299 | ||
300 | trace_xfs_dir2_sf_addname(args); | 300 | trace_xfs_dir2_sf_addname(args); |
301 | 301 | ||
302 | ASSERT(xfs_dir2_sf_lookup(args) == ENOENT); | 302 | ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT); |
303 | dp = args->dp; | 303 | dp = args->dp; |
304 | ASSERT(dp->i_df.if_flags & XFS_IFINLINE); | 304 | ASSERT(dp->i_df.if_flags & XFS_IFINLINE); |
305 | /* | 305 | /* |
@@ -307,7 +307,7 @@ xfs_dir2_sf_addname( | |||
307 | */ | 307 | */ |
308 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { | 308 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { |
309 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); | 309 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); |
310 | return EIO; | 310 | return -EIO; |
311 | } | 311 | } |
312 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 312 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
313 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 313 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
@@ -345,7 +345,7 @@ xfs_dir2_sf_addname( | |||
345 | * Just checking or no space reservation, it doesn't fit. | 345 | * Just checking or no space reservation, it doesn't fit. |
346 | */ | 346 | */ |
347 | if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || args->total == 0) | 347 | if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || args->total == 0) |
348 | return ENOSPC; | 348 | return -ENOSPC; |
349 | /* | 349 | /* |
350 | * Convert to block form then add the name. | 350 | * Convert to block form then add the name. |
351 | */ | 351 | */ |
@@ -738,7 +738,7 @@ xfs_dir2_sf_lookup( | |||
738 | */ | 738 | */ |
739 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { | 739 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { |
740 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); | 740 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); |
741 | return EIO; | 741 | return -EIO; |
742 | } | 742 | } |
743 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 743 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
744 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 744 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
@@ -751,7 +751,7 @@ xfs_dir2_sf_lookup( | |||
751 | args->inumber = dp->i_ino; | 751 | args->inumber = dp->i_ino; |
752 | args->cmpresult = XFS_CMP_EXACT; | 752 | args->cmpresult = XFS_CMP_EXACT; |
753 | args->filetype = XFS_DIR3_FT_DIR; | 753 | args->filetype = XFS_DIR3_FT_DIR; |
754 | return EEXIST; | 754 | return -EEXIST; |
755 | } | 755 | } |
756 | /* | 756 | /* |
757 | * Special case for .. | 757 | * Special case for .. |
@@ -761,7 +761,7 @@ xfs_dir2_sf_lookup( | |||
761 | args->inumber = dp->d_ops->sf_get_parent_ino(sfp); | 761 | args->inumber = dp->d_ops->sf_get_parent_ino(sfp); |
762 | args->cmpresult = XFS_CMP_EXACT; | 762 | args->cmpresult = XFS_CMP_EXACT; |
763 | args->filetype = XFS_DIR3_FT_DIR; | 763 | args->filetype = XFS_DIR3_FT_DIR; |
764 | return EEXIST; | 764 | return -EEXIST; |
765 | } | 765 | } |
766 | /* | 766 | /* |
767 | * Loop over all the entries trying to match ours. | 767 | * Loop over all the entries trying to match ours. |
@@ -781,17 +781,17 @@ xfs_dir2_sf_lookup( | |||
781 | args->inumber = dp->d_ops->sf_get_ino(sfp, sfep); | 781 | args->inumber = dp->d_ops->sf_get_ino(sfp, sfep); |
782 | args->filetype = dp->d_ops->sf_get_ftype(sfep); | 782 | args->filetype = dp->d_ops->sf_get_ftype(sfep); |
783 | if (cmp == XFS_CMP_EXACT) | 783 | if (cmp == XFS_CMP_EXACT) |
784 | return EEXIST; | 784 | return -EEXIST; |
785 | ci_sfep = sfep; | 785 | ci_sfep = sfep; |
786 | } | 786 | } |
787 | } | 787 | } |
788 | ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); | 788 | ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); |
789 | /* | 789 | /* |
790 | * Here, we can only be doing a lookup (not a rename or replace). | 790 | * Here, we can only be doing a lookup (not a rename or replace). |
791 | * If a case-insensitive match was not found, return ENOENT. | 791 | * If a case-insensitive match was not found, return -ENOENT. |
792 | */ | 792 | */ |
793 | if (!ci_sfep) | 793 | if (!ci_sfep) |
794 | return ENOENT; | 794 | return -ENOENT; |
795 | /* otherwise process the CI match as required by the caller */ | 795 | /* otherwise process the CI match as required by the caller */ |
796 | error = xfs_dir_cilookup_result(args, ci_sfep->name, ci_sfep->namelen); | 796 | error = xfs_dir_cilookup_result(args, ci_sfep->name, ci_sfep->namelen); |
797 | return error; | 797 | return error; |
@@ -824,7 +824,7 @@ xfs_dir2_sf_removename( | |||
824 | */ | 824 | */ |
825 | if (oldsize < offsetof(xfs_dir2_sf_hdr_t, parent)) { | 825 | if (oldsize < offsetof(xfs_dir2_sf_hdr_t, parent)) { |
826 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); | 826 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); |
827 | return EIO; | 827 | return -EIO; |
828 | } | 828 | } |
829 | ASSERT(dp->i_df.if_bytes == oldsize); | 829 | ASSERT(dp->i_df.if_bytes == oldsize); |
830 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 830 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
@@ -847,7 +847,7 @@ xfs_dir2_sf_removename( | |||
847 | * Didn't find it. | 847 | * Didn't find it. |
848 | */ | 848 | */ |
849 | if (i == sfp->count) | 849 | if (i == sfp->count) |
850 | return ENOENT; | 850 | return -ENOENT; |
851 | /* | 851 | /* |
852 | * Calculate sizes. | 852 | * Calculate sizes. |
853 | */ | 853 | */ |
@@ -914,7 +914,7 @@ xfs_dir2_sf_replace( | |||
914 | */ | 914 | */ |
915 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { | 915 | if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) { |
916 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); | 916 | ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount)); |
917 | return EIO; | 917 | return -EIO; |
918 | } | 918 | } |
919 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 919 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
920 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 920 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
@@ -990,7 +990,7 @@ xfs_dir2_sf_replace( | |||
990 | if (i8elevated) | 990 | if (i8elevated) |
991 | xfs_dir2_sf_toino4(args); | 991 | xfs_dir2_sf_toino4(args); |
992 | #endif | 992 | #endif |
993 | return ENOENT; | 993 | return -ENOENT; |
994 | } | 994 | } |
995 | } | 995 | } |
996 | #if XFS_BIG_INUMS | 996 | #if XFS_BIG_INUMS |