diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-25 08:58:08 +0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-25 08:58:08 +0400 |
commit | 2451337dd043901b5270b7586942abe564443e3d (patch) | |
tree | 5f2a59b2c829dbb942c18315ffc0edfed0d3790a /fs/xfs/xfs_itable.c | |
parent | 30f712c9dd69348aa51351d5cb6d366bf4fae31d (diff) | |
download | linux-2451337dd043901b5270b7586942abe564443e3d.tar.xz |
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/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index e4056a7495e5..7e54992bcae9 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -67,11 +67,11 @@ xfs_bulkstat_one_int( *stat = BULKSTAT_RV_NOTHING; if (!buffer || xfs_internal_inum(mp, ino)) - return EINVAL; + return -EINVAL; buf = kmem_alloc(sizeof(*buf), KM_SLEEP | KM_MAYFAIL); if (!buf) - return ENOMEM; + return -ENOMEM; error = xfs_iget(mp, NULL, ino, (XFS_IGET_DONTCACHE | XFS_IGET_UNTRUSTED), @@ -154,9 +154,9 @@ xfs_bulkstat_one_fmt( const xfs_bstat_t *buffer) { if (ubsize < sizeof(*buffer)) - return ENOMEM; + return -ENOMEM; if (copy_to_user(ubuffer, buffer, sizeof(*buffer))) - return EFAULT; + return -EFAULT; if (ubused) *ubused = sizeof(*buffer); return 0; @@ -234,7 +234,7 @@ xfs_bulkstat( return 0; } if (!ubcountp || *ubcountp <= 0) { - return EINVAL; + return -EINVAL; } ubcount = *ubcountp; /* statstruct's */ ubleft = ubcount * statstruct_size; /* bytes */ @@ -246,7 +246,7 @@ xfs_bulkstat( inodes_per_cluster = blks_per_cluster << mp->m_sb.sb_inopblog; irbuf = kmem_zalloc_greedy(&irbsize, PAGE_SIZE, PAGE_SIZE * 4); if (!irbuf) - return ENOMEM; + return -ENOMEM; nirbuf = irbsize / sizeof(*irbuf); @@ -452,8 +452,8 @@ xfs_bulkstat( error = formatter(mp, ino, ubufp, ubleft, &ubused, &fmterror); if (fmterror == BULKSTAT_RV_NOTHING) { - if (error && error != ENOENT && - error != EINVAL) { + if (error && error != -ENOENT && + error != -EINVAL) { ubleft = 0; rval = error; break; @@ -551,7 +551,7 @@ xfs_bulkstat_single( sizeof(xfs_bstat_t), buffer, done)) return error; if (count == 0 || (xfs_ino_t)*lastinop != ino) - return error == EFSCORRUPTED ? + return error == -EFSCORRUPTED ? EINVAL : error; else return 0; @@ -661,7 +661,7 @@ xfs_inumbers( if (bufidx == bcount) { long written; if (formatter(ubuffer, buffer, bufidx, &written)) { - error = EFAULT; + error = -EFAULT; break; } ubuffer += written; @@ -688,7 +688,7 @@ xfs_inumbers( if (bufidx) { long written; if (formatter(ubuffer, buffer, bufidx, &written)) - error = EFAULT; + error = -EFAULT; else *count += bufidx; } |