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.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.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index a0aca734199b..6cef22152fd6 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c | |||
@@ -108,7 +108,7 @@ xfs_da_mount( | |||
108 | if (!mp->m_dir_geo || !mp->m_attr_geo) { | 108 | if (!mp->m_dir_geo || !mp->m_attr_geo) { |
109 | kmem_free(mp->m_dir_geo); | 109 | kmem_free(mp->m_dir_geo); |
110 | kmem_free(mp->m_attr_geo); | 110 | kmem_free(mp->m_attr_geo); |
111 | return ENOMEM; | 111 | return -ENOMEM; |
112 | } | 112 | } |
113 | 113 | ||
114 | /* set up directory geometry */ | 114 | /* set up directory geometry */ |
@@ -202,7 +202,7 @@ xfs_dir_ino_validate( | |||
202 | xfs_warn(mp, "Invalid inode number 0x%Lx", | 202 | xfs_warn(mp, "Invalid inode number 0x%Lx", |
203 | (unsigned long long) ino); | 203 | (unsigned long long) ino); |
204 | XFS_ERROR_REPORT("xfs_dir_ino_validate", XFS_ERRLEVEL_LOW, mp); | 204 | XFS_ERROR_REPORT("xfs_dir_ino_validate", XFS_ERRLEVEL_LOW, mp); |
205 | return EFSCORRUPTED; | 205 | return -EFSCORRUPTED; |
206 | } | 206 | } |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
@@ -226,7 +226,7 @@ xfs_dir_init( | |||
226 | 226 | ||
227 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); | 227 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); |
228 | if (!args) | 228 | if (!args) |
229 | return ENOMEM; | 229 | return -ENOMEM; |
230 | 230 | ||
231 | args->geo = dp->i_mount->m_dir_geo; | 231 | args->geo = dp->i_mount->m_dir_geo; |
232 | args->dp = dp; | 232 | args->dp = dp; |
@@ -261,7 +261,7 @@ xfs_dir_createname( | |||
261 | 261 | ||
262 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); | 262 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); |
263 | if (!args) | 263 | if (!args) |
264 | return ENOMEM; | 264 | return -ENOMEM; |
265 | 265 | ||
266 | args->geo = dp->i_mount->m_dir_geo; | 266 | args->geo = dp->i_mount->m_dir_geo; |
267 | args->name = name->name; | 267 | args->name = name->name; |
@@ -314,18 +314,18 @@ xfs_dir_cilookup_result( | |||
314 | int len) | 314 | int len) |
315 | { | 315 | { |
316 | if (args->cmpresult == XFS_CMP_DIFFERENT) | 316 | if (args->cmpresult == XFS_CMP_DIFFERENT) |
317 | return ENOENT; | 317 | return -ENOENT; |
318 | if (args->cmpresult != XFS_CMP_CASE || | 318 | if (args->cmpresult != XFS_CMP_CASE || |
319 | !(args->op_flags & XFS_DA_OP_CILOOKUP)) | 319 | !(args->op_flags & XFS_DA_OP_CILOOKUP)) |
320 | return EEXIST; | 320 | return -EEXIST; |
321 | 321 | ||
322 | args->value = kmem_alloc(len, KM_NOFS | KM_MAYFAIL); | 322 | args->value = kmem_alloc(len, KM_NOFS | KM_MAYFAIL); |
323 | if (!args->value) | 323 | if (!args->value) |
324 | return ENOMEM; | 324 | return -ENOMEM; |
325 | 325 | ||
326 | memcpy(args->value, name, len); | 326 | memcpy(args->value, name, len); |
327 | args->valuelen = len; | 327 | args->valuelen = len; |
328 | return EEXIST; | 328 | return -EEXIST; |
329 | } | 329 | } |
330 | 330 | ||
331 | /* | 331 | /* |
@@ -392,7 +392,7 @@ xfs_dir_lookup( | |||
392 | rval = xfs_dir2_node_lookup(args); | 392 | rval = xfs_dir2_node_lookup(args); |
393 | 393 | ||
394 | out_check_rval: | 394 | out_check_rval: |
395 | if (rval == EEXIST) | 395 | if (rval == -EEXIST) |
396 | rval = 0; | 396 | rval = 0; |
397 | if (!rval) { | 397 | if (!rval) { |
398 | *inum = args->inumber; | 398 | *inum = args->inumber; |
@@ -428,7 +428,7 @@ xfs_dir_removename( | |||
428 | 428 | ||
429 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); | 429 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); |
430 | if (!args) | 430 | if (!args) |
431 | return ENOMEM; | 431 | return -ENOMEM; |
432 | 432 | ||
433 | args->geo = dp->i_mount->m_dir_geo; | 433 | args->geo = dp->i_mount->m_dir_geo; |
434 | args->name = name->name; | 434 | args->name = name->name; |
@@ -493,7 +493,7 @@ xfs_dir_replace( | |||
493 | 493 | ||
494 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); | 494 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); |
495 | if (!args) | 495 | if (!args) |
496 | return ENOMEM; | 496 | return -ENOMEM; |
497 | 497 | ||
498 | args->geo = dp->i_mount->m_dir_geo; | 498 | args->geo = dp->i_mount->m_dir_geo; |
499 | args->name = name->name; | 499 | args->name = name->name; |
@@ -555,7 +555,7 @@ xfs_dir_canenter( | |||
555 | 555 | ||
556 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); | 556 | args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); |
557 | if (!args) | 557 | if (!args) |
558 | return ENOMEM; | 558 | return -ENOMEM; |
559 | 559 | ||
560 | args->geo = dp->i_mount->m_dir_geo; | 560 | args->geo = dp->i_mount->m_dir_geo; |
561 | args->name = name->name; | 561 | args->name = name->name; |