Commit 7dce11db authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dave Chinner

xfs: always use iget in bulkstat

The non-coherent bulkstat versionsthat look directly at the inode
buffers causes various problems with performance optimizations that
make increased use of just logging inodes.  This patch makes bulkstat
always use iget, which should be fast enough for normal use with the
radix-tree based inode cache introduced a while ago.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 1817176a
...@@ -679,10 +679,9 @@ xfs_ioc_bulkstat( ...@@ -679,10 +679,9 @@ xfs_ioc_bulkstat(
error = xfs_bulkstat_single(mp, &inlast, error = xfs_bulkstat_single(mp, &inlast,
bulkreq.ubuffer, &done); bulkreq.ubuffer, &done);
else /* XFS_IOC_FSBULKSTAT */ else /* XFS_IOC_FSBULKSTAT */
error = xfs_bulkstat(mp, &inlast, &count, error = xfs_bulkstat(mp, &inlast, &count, xfs_bulkstat_one,
(bulkstat_one_pf)xfs_bulkstat_one, NULL, sizeof(xfs_bstat_t), bulkreq.ubuffer,
sizeof(xfs_bstat_t), bulkreq.ubuffer, &done);
BULKSTAT_FG_QUICK, &done);
if (error) if (error)
return -error; return -error;
......
...@@ -237,15 +237,13 @@ xfs_bulkstat_one_compat( ...@@ -237,15 +237,13 @@ xfs_bulkstat_one_compat(
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* buffer to place output in */ void __user *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */ int ubsize, /* size of buffer */
void *private_data, /* my private data */
xfs_daddr_t bno, /* starting bno of inode cluster */ xfs_daddr_t bno, /* starting bno of inode cluster */
int *ubused, /* bytes used by me */ int *ubused, /* bytes used by me */
void *dibuff, /* on-disk inode buffer */
int *stat) /* BULKSTAT_RV_... */ int *stat) /* BULKSTAT_RV_... */
{ {
return xfs_bulkstat_one_int(mp, ino, buffer, ubsize, return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
xfs_bulkstat_one_fmt_compat, bno, xfs_bulkstat_one_fmt_compat, bno,
ubused, dibuff, stat); ubused, stat);
} }
/* copied from xfs_ioctl.c */ /* copied from xfs_ioctl.c */
...@@ -298,13 +296,11 @@ xfs_compat_ioc_bulkstat( ...@@ -298,13 +296,11 @@ xfs_compat_ioc_bulkstat(
int res; int res;
error = xfs_bulkstat_one_compat(mp, inlast, bulkreq.ubuffer, error = xfs_bulkstat_one_compat(mp, inlast, bulkreq.ubuffer,
sizeof(compat_xfs_bstat_t), sizeof(compat_xfs_bstat_t), 0, NULL, &res);
NULL, 0, NULL, NULL, &res);
} else if (cmd == XFS_IOC_FSBULKSTAT_32) { } else if (cmd == XFS_IOC_FSBULKSTAT_32) {
error = xfs_bulkstat(mp, &inlast, &count, error = xfs_bulkstat(mp, &inlast, &count,
xfs_bulkstat_one_compat, NULL, xfs_bulkstat_one_compat, sizeof(compat_xfs_bstat_t),
sizeof(compat_xfs_bstat_t), bulkreq.ubuffer, bulkreq.ubuffer, &done);
BULKSTAT_FG_QUICK, &done);
} else } else
error = XFS_ERROR(EINVAL); error = XFS_ERROR(EINVAL);
if (error) if (error)
......
...@@ -1632,10 +1632,8 @@ xfs_qm_dqusage_adjust( ...@@ -1632,10 +1632,8 @@ xfs_qm_dqusage_adjust(
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* not used */ void __user *buffer, /* not used */
int ubsize, /* not used */ int ubsize, /* not used */
void *private_data, /* not used */
xfs_daddr_t bno, /* starting block of inode cluster */ xfs_daddr_t bno, /* starting block of inode cluster */
int *ubused, /* not used */ int *ubused, /* not used */
void *dip, /* on-disk inode pointer (not used) */
int *res) /* result code value */ int *res) /* result code value */
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
...@@ -1796,12 +1794,13 @@ xfs_qm_quotacheck( ...@@ -1796,12 +1794,13 @@ xfs_qm_quotacheck(
* Iterate thru all the inodes in the file system, * Iterate thru all the inodes in the file system,
* adjusting the corresponding dquot counters in core. * adjusting the corresponding dquot counters in core.
*/ */
if ((error = xfs_bulkstat(mp, &lastino, &count, error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_dqusage_adjust, NULL, xfs_qm_dqusage_adjust,
structsz, NULL, BULKSTAT_FG_IGET, &done))) structsz, NULL, &done);
if (error)
break; break;
} while (! done); } while (!done);
/* /*
* We've made all the changes that we need to make incore. * We've made all the changes that we need to make incore.
......
...@@ -1109,10 +1109,8 @@ xfs_qm_internalqcheck_adjust( ...@@ -1109,10 +1109,8 @@ xfs_qm_internalqcheck_adjust(
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* not used */ void __user *buffer, /* not used */
int ubsize, /* not used */ int ubsize, /* not used */
void *private_data, /* not used */
xfs_daddr_t bno, /* starting block of inode cluster */ xfs_daddr_t bno, /* starting block of inode cluster */
int *ubused, /* not used */ int *ubused, /* not used */
void *dip, /* not used */
int *res) /* bulkstat result code */ int *res) /* bulkstat result code */
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
...@@ -1205,15 +1203,15 @@ xfs_qm_internalqcheck( ...@@ -1205,15 +1203,15 @@ xfs_qm_internalqcheck(
* Iterate thru all the inodes in the file system, * Iterate thru all the inodes in the file system,
* adjusting the corresponding dquot counters * adjusting the corresponding dquot counters
*/ */
if ((error = xfs_bulkstat(mp, &lastino, &count, error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_internalqcheck_adjust, NULL, xfs_qm_internalqcheck_adjust,
0, NULL, BULKSTAT_FG_IGET, &done))) { 0, NULL, &done);
if (error) {
cmn_err(CE_DEBUG, "Bulkstat returned error 0x%x", error);
break; break;
} }
} while (! done); } while (!done);
if (error) {
cmn_err(CE_DEBUG, "Bulkstat returned error 0x%x", error);
}
cmn_err(CE_DEBUG, "Checking results against system dquots"); cmn_err(CE_DEBUG, "Checking results against system dquots");
for (i = 0; i < qmtest_hashmask; i++) { for (i = 0; i < qmtest_hashmask; i++) {
xfs_dqtest_t *d, *n; xfs_dqtest_t *d, *n;
......
This diff is collapsed.
...@@ -27,10 +27,8 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp, ...@@ -27,10 +27,8 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
xfs_ino_t ino, xfs_ino_t ino,
void __user *buffer, void __user *buffer,
int ubsize, int ubsize,
void *private_data,
xfs_daddr_t bno, xfs_daddr_t bno,
int *ubused, int *ubused,
void *dip,
int *stat); int *stat);
/* /*
...@@ -40,13 +38,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp, ...@@ -40,13 +38,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
#define BULKSTAT_RV_DIDONE 1 #define BULKSTAT_RV_DIDONE 1
#define BULKSTAT_RV_GIVEUP 2 #define BULKSTAT_RV_GIVEUP 2
/*
* Values for bulkstat flag argument.
*/
#define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */
#define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */
#define BULKSTAT_FG_INLINE 0x4 /* No iget if inline attrs */
/* /*
* Return stat information in bulk (by-inode) for the filesystem. * Return stat information in bulk (by-inode) for the filesystem.
*/ */
...@@ -56,10 +47,8 @@ xfs_bulkstat( ...@@ -56,10 +47,8 @@ xfs_bulkstat(
xfs_ino_t *lastino, /* last inode returned */ xfs_ino_t *lastino, /* last inode returned */
int *count, /* size of buffer/count returned */ int *count, /* size of buffer/count returned */
bulkstat_one_pf formatter, /* func that'd fill a single buf */ bulkstat_one_pf formatter, /* func that'd fill a single buf */
void *private_data, /* private data for formatter */
size_t statstruct_size,/* sizeof struct that we're filling */ size_t statstruct_size,/* sizeof struct that we're filling */
char __user *ubuffer,/* buffer with inode stats */ char __user *ubuffer,/* buffer with inode stats */
int flags, /* flag to control access method */
int *done); /* 1 if there are more stats to get */ int *done); /* 1 if there are more stats to get */
int int
...@@ -84,7 +73,6 @@ xfs_bulkstat_one_int( ...@@ -84,7 +73,6 @@ xfs_bulkstat_one_int(
bulkstat_one_fmt_pf formatter, bulkstat_one_fmt_pf formatter,
xfs_daddr_t bno, xfs_daddr_t bno,
int *ubused, int *ubused,
void *dibuff,
int *stat); int *stat);
int int
...@@ -93,10 +81,8 @@ xfs_bulkstat_one( ...@@ -93,10 +81,8 @@ xfs_bulkstat_one(
xfs_ino_t ino, xfs_ino_t ino,
void __user *buffer, void __user *buffer,
int ubsize, int ubsize,
void *private_data,
xfs_daddr_t bno, xfs_daddr_t bno,
int *ubused, int *ubused,
void *dibuff,
int *stat); int *stat);
typedef int (*inumbers_fmt_pf)( typedef int (*inumbers_fmt_pf)(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment