diff options
| author | Christoph Hellwig <hch@lst.de> | 2014-07-23 22:07:15 -0400 |
|---|---|---|
| committer | Dave Chinner <david@fromorbit.com> | 2014-07-23 22:07:15 -0400 |
| commit | d716f8eedb143387afd35d337327090b8348159e (patch) | |
| tree | cdaa237b8bbc2283d547c44cb1c0d1e20c773feb | |
| parent | 8fe657760d5c8372cd4cf022c4cdb9307a3af995 (diff) | |
xfs: remove xfs_bulkstat_single
From: Christoph Hellwig <hch@lst.de>
xfs_bukstat_one doesn't have any failure case that would go away when
called through xfs_bulkstat, so remove the fallback and the now unessecary
xfs_bulkstat_single function.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
| -rw-r--r-- | fs/xfs/xfs_ioctl.c | 4 | ||||
| -rw-r--r-- | fs/xfs/xfs_itable.c | 48 | ||||
| -rw-r--r-- | fs/xfs/xfs_itable.h | 7 |
3 files changed, 2 insertions, 57 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 30983b8ceaa1..494237ed4a65 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
| @@ -796,8 +796,8 @@ xfs_ioc_bulkstat( | |||
| 796 | error = xfs_inumbers(mp, &inlast, &count, | 796 | error = xfs_inumbers(mp, &inlast, &count, |
| 797 | bulkreq.ubuffer, xfs_inumbers_fmt); | 797 | bulkreq.ubuffer, xfs_inumbers_fmt); |
| 798 | else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE) | 798 | else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE) |
| 799 | error = xfs_bulkstat_single(mp, &inlast, | 799 | error = xfs_bulkstat_one(mp, inlast, bulkreq.ubuffer, |
| 800 | bulkreq.ubuffer, &done); | 800 | sizeof(xfs_bstat_t), NULL, &done); |
| 801 | else /* XFS_IOC_FSBULKSTAT */ | 801 | else /* XFS_IOC_FSBULKSTAT */ |
| 802 | error = xfs_bulkstat(mp, &inlast, &count, xfs_bulkstat_one, | 802 | error = xfs_bulkstat(mp, &inlast, &count, xfs_bulkstat_one, |
| 803 | sizeof(xfs_bstat_t), bulkreq.ubuffer, | 803 | sizeof(xfs_bstat_t), bulkreq.ubuffer, |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index ca15214f1772..e15df1f70d79 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
| @@ -509,54 +509,6 @@ xfs_bulkstat( | |||
| 509 | return rval; | 509 | return rval; |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | /* | ||
| 513 | * Return stat information in bulk (by-inode) for the filesystem. | ||
| 514 | * Special case for non-sequential one inode bulkstat. | ||
| 515 | */ | ||
| 516 | int /* error status */ | ||
| 517 | xfs_bulkstat_single( | ||
| 518 | xfs_mount_t *mp, /* mount point for filesystem */ | ||
| 519 | xfs_ino_t *lastinop, /* inode to return */ | ||
| 520 | char __user *buffer, /* buffer with inode stats */ | ||
| 521 | int *done) /* 1 if there are more stats to get */ | ||
| 522 | { | ||
| 523 | int count; /* count value for bulkstat call */ | ||
| 524 | int error; /* return value */ | ||
| 525 | xfs_ino_t ino; /* filesystem inode number */ | ||
| 526 | int res; /* result from bs1 */ | ||
| 527 | |||
| 528 | /* | ||
| 529 | * note that requesting valid inode numbers which are not allocated | ||
| 530 | * to inodes will most likely cause xfs_imap_to_bp to generate warning | ||
| 531 | * messages about bad magic numbers. This is ok. The fact that | ||
| 532 | * the inode isn't actually an inode is handled by the | ||
| 533 | * error check below. Done this way to make the usual case faster | ||
| 534 | * at the expense of the error case. | ||
| 535 | */ | ||
| 536 | |||
| 537 | ino = *lastinop; | ||
| 538 | error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t), | ||
| 539 | NULL, &res); | ||
| 540 | if (error) { | ||
| 541 | /* | ||
| 542 | * Special case way failed, do it the "long" way | ||
| 543 | * to see if that works. | ||
| 544 | */ | ||
| 545 | (*lastinop)--; | ||
| 546 | count = 1; | ||
| 547 | if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one, | ||
| 548 | sizeof(xfs_bstat_t), buffer, done)) | ||
| 549 | return error; | ||
| 550 | if (count == 0 || (xfs_ino_t)*lastinop != ino) | ||
| 551 | return error == -EFSCORRUPTED ? | ||
| 552 | EINVAL : error; | ||
| 553 | else | ||
| 554 | return 0; | ||
| 555 | } | ||
| 556 | *done = 0; | ||
| 557 | return 0; | ||
| 558 | } | ||
| 559 | |||
| 560 | int | 512 | int |
| 561 | xfs_inumbers_fmt( | 513 | xfs_inumbers_fmt( |
| 562 | void __user *ubuffer, /* buffer to write to */ | 514 | void __user *ubuffer, /* buffer to write to */ |
diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h index 97295d91d170..6ea8b3912fa4 100644 --- a/fs/xfs/xfs_itable.h +++ b/fs/xfs/xfs_itable.h | |||
| @@ -50,13 +50,6 @@ xfs_bulkstat( | |||
| 50 | char __user *ubuffer,/* buffer with inode stats */ | 50 | char __user *ubuffer,/* buffer with inode stats */ |
| 51 | int *done); /* 1 if there are more stats to get */ | 51 | int *done); /* 1 if there are more stats to get */ |
| 52 | 52 | ||
| 53 | int | ||
| 54 | xfs_bulkstat_single( | ||
| 55 | xfs_mount_t *mp, | ||
| 56 | xfs_ino_t *lastinop, | ||
| 57 | char __user *buffer, | ||
| 58 | int *done); | ||
| 59 | |||
| 60 | typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */ | 53 | typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */ |
| 61 | void __user *ubuffer, /* buffer to write to */ | 54 | void __user *ubuffer, /* buffer to write to */ |
| 62 | int ubsize, /* remaining user buffer sz */ | 55 | int ubsize, /* remaining user buffer sz */ |
