aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ioctl32.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-06-25 00:58:08 -0400
committerDave Chinner <david@fromorbit.com>2014-06-25 00:58:08 -0400
commit2451337dd043901b5270b7586942abe564443e3d (patch)
tree5f2a59b2c829dbb942c18315ffc0edfed0d3790a /fs/xfs/xfs_ioctl32.c
parent30f712c9dd69348aa51351d5cb6d366bf4fae31d (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/xfs_ioctl32.c')
-rw-r--r--fs/xfs/xfs_ioctl32.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
index 357963ec9ba6..e65ea67e3ae3 100644
--- a/fs/xfs/xfs_ioctl32.c
+++ b/fs/xfs/xfs_ioctl32.c
@@ -70,7 +70,7 @@ xfs_compat_ioc_fsgeometry_v1(
70 70
71 error = xfs_fs_geometry(mp, &fsgeo, 3); 71 error = xfs_fs_geometry(mp, &fsgeo, 3);
72 if (error) 72 if (error)
73 return -error; 73 return error;
74 /* The 32-bit variant simply has some padding at the end */ 74 /* The 32-bit variant simply has some padding at the end */
75 if (copy_to_user(arg32, &fsgeo, sizeof(struct compat_xfs_fsop_geom_v1))) 75 if (copy_to_user(arg32, &fsgeo, sizeof(struct compat_xfs_fsop_geom_v1)))
76 return -EFAULT; 76 return -EFAULT;
@@ -195,7 +195,7 @@ xfs_bulkstat_one_fmt_compat(
195 compat_xfs_bstat_t __user *p32 = ubuffer; 195 compat_xfs_bstat_t __user *p32 = ubuffer;
196 196
197 if (ubsize < sizeof(*p32)) 197 if (ubsize < sizeof(*p32))
198 return ENOMEM; 198 return -ENOMEM;
199 199
200 if (put_user(buffer->bs_ino, &p32->bs_ino) || 200 if (put_user(buffer->bs_ino, &p32->bs_ino) ||
201 put_user(buffer->bs_mode, &p32->bs_mode) || 201 put_user(buffer->bs_mode, &p32->bs_mode) ||
@@ -218,7 +218,7 @@ xfs_bulkstat_one_fmt_compat(
218 put_user(buffer->bs_dmevmask, &p32->bs_dmevmask) || 218 put_user(buffer->bs_dmevmask, &p32->bs_dmevmask) ||
219 put_user(buffer->bs_dmstate, &p32->bs_dmstate) || 219 put_user(buffer->bs_dmstate, &p32->bs_dmstate) ||
220 put_user(buffer->bs_aextents, &p32->bs_aextents)) 220 put_user(buffer->bs_aextents, &p32->bs_aextents))
221 return EFAULT; 221 return -EFAULT;
222 if (ubused) 222 if (ubused)
223 *ubused = sizeof(*p32); 223 *ubused = sizeof(*p32);
224 return 0; 224 return 0;
@@ -294,9 +294,9 @@ xfs_compat_ioc_bulkstat(
294 xfs_bulkstat_one_compat, sizeof(compat_xfs_bstat_t), 294 xfs_bulkstat_one_compat, sizeof(compat_xfs_bstat_t),
295 bulkreq.ubuffer, &done); 295 bulkreq.ubuffer, &done);
296 } else 296 } else
297 error = EINVAL; 297 error = -EINVAL;
298 if (error) 298 if (error)
299 return -error; 299 return error;
300 300
301 if (bulkreq.ocount != NULL) { 301 if (bulkreq.ocount != NULL) {
302 if (copy_to_user(bulkreq.lastip, &inlast, 302 if (copy_to_user(bulkreq.lastip, &inlast,
@@ -376,7 +376,7 @@ xfs_compat_attrlist_by_handle(
376 goto out_dput; 376 goto out_dput;
377 377
378 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; 378 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
379 error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, 379 error = xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen,
380 al_hreq.flags, cursor); 380 al_hreq.flags, cursor);
381 if (error) 381 if (error)
382 goto out_kfree; 382 goto out_kfree;
@@ -417,7 +417,7 @@ xfs_compat_attrmulti_by_handle(
417 if (IS_ERR(dentry)) 417 if (IS_ERR(dentry))
418 return PTR_ERR(dentry); 418 return PTR_ERR(dentry);
419 419
420 error = E2BIG; 420 error = -E2BIG;
421 size = am_hreq.opcount * sizeof(compat_xfs_attr_multiop_t); 421 size = am_hreq.opcount * sizeof(compat_xfs_attr_multiop_t);
422 if (!size || size > 16 * PAGE_SIZE) 422 if (!size || size > 16 * PAGE_SIZE)
423 goto out_dput; 423 goto out_dput;
@@ -428,7 +428,7 @@ xfs_compat_attrmulti_by_handle(
428 goto out_dput; 428 goto out_dput;
429 } 429 }
430 430
431 error = ENOMEM; 431 error = -ENOMEM;
432 attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); 432 attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL);
433 if (!attr_name) 433 if (!attr_name)
434 goto out_kfree_ops; 434 goto out_kfree_ops;
@@ -439,7 +439,7 @@ xfs_compat_attrmulti_by_handle(
439 compat_ptr(ops[i].am_attrname), 439 compat_ptr(ops[i].am_attrname),
440 MAXNAMELEN); 440 MAXNAMELEN);
441 if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN) 441 if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
442 error = ERANGE; 442 error = -ERANGE;
443 if (ops[i].am_error < 0) 443 if (ops[i].am_error < 0)
444 break; 444 break;
445 445
@@ -470,19 +470,19 @@ xfs_compat_attrmulti_by_handle(
470 mnt_drop_write_file(parfilp); 470 mnt_drop_write_file(parfilp);
471 break; 471 break;
472 default: 472 default:
473 ops[i].am_error = EINVAL; 473 ops[i].am_error = -EINVAL;
474 } 474 }
475 } 475 }
476 476
477 if (copy_to_user(compat_ptr(am_hreq.ops), ops, size)) 477 if (copy_to_user(compat_ptr(am_hreq.ops), ops, size))
478 error = EFAULT; 478 error = -EFAULT;
479 479
480 kfree(attr_name); 480 kfree(attr_name);
481 out_kfree_ops: 481 out_kfree_ops:
482 kfree(ops); 482 kfree(ops);
483 out_dput: 483 out_dput:
484 dput(dentry); 484 dput(dentry);
485 return -error; 485 return error;
486} 486}
487 487
488STATIC int 488STATIC int
@@ -515,7 +515,7 @@ xfs_compat_fssetdm_by_handle(
515 goto out; 515 goto out;
516 } 516 }
517 517
518 error = -xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask, 518 error = xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask,
519 fsd.fsd_dmstate); 519 fsd.fsd_dmstate);
520 520
521out: 521out:
@@ -604,7 +604,7 @@ xfs_file_compat_ioctl(
604 return error; 604 return error;
605 error = xfs_growfs_data(mp, &in); 605 error = xfs_growfs_data(mp, &in);
606 mnt_drop_write_file(filp); 606 mnt_drop_write_file(filp);
607 return -error; 607 return error;
608 } 608 }
609 case XFS_IOC_FSGROWFSRT_32: { 609 case XFS_IOC_FSGROWFSRT_32: {
610 struct xfs_growfs_rt in; 610 struct xfs_growfs_rt in;
@@ -616,7 +616,7 @@ xfs_file_compat_ioctl(
616 return error; 616 return error;
617 error = xfs_growfs_rt(mp, &in); 617 error = xfs_growfs_rt(mp, &in);
618 mnt_drop_write_file(filp); 618 mnt_drop_write_file(filp);
619 return -error; 619 return error;
620 } 620 }
621#endif 621#endif
622 /* long changes size, but xfs only copiese out 32 bits */ 622 /* long changes size, but xfs only copiese out 32 bits */
@@ -639,7 +639,7 @@ xfs_file_compat_ioctl(
639 return error; 639 return error;
640 error = xfs_ioc_swapext(&sxp); 640 error = xfs_ioc_swapext(&sxp);
641 mnt_drop_write_file(filp); 641 mnt_drop_write_file(filp);
642 return -error; 642 return error;
643 } 643 }
644 case XFS_IOC_FSBULKSTAT_32: 644 case XFS_IOC_FSBULKSTAT_32:
645 case XFS_IOC_FSBULKSTAT_SINGLE_32: 645 case XFS_IOC_FSBULKSTAT_SINGLE_32: