Commit 1dee7094 authored by Nathan Scott's avatar Nathan Scott

[XFS] Remove unused transaction pointer from bulkstat.

SGI Modid: xfs-linux:xfs-kern:171081a
parent 0a9bde57
...@@ -941,7 +941,7 @@ xfs_ioc_bulkstat( ...@@ -941,7 +941,7 @@ xfs_ioc_bulkstat(
return -XFS_ERROR(EINVAL); return -XFS_ERROR(EINVAL);
if (cmd == XFS_IOC_FSINUMBERS) if (cmd == XFS_IOC_FSINUMBERS)
error = xfs_inumbers(mp, NULL, &inlast, &count, error = xfs_inumbers(mp, &inlast, &count,
bulkreq.ubuffer); bulkreq.ubuffer);
else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE) else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE)
error = xfs_bulkstat_single(mp, &inlast, error = xfs_bulkstat_single(mp, &inlast,
...@@ -952,7 +952,7 @@ xfs_ioc_bulkstat( ...@@ -952,7 +952,7 @@ xfs_ioc_bulkstat(
error = xfs_bulkstat_single(mp, &inlast, error = xfs_bulkstat_single(mp, &inlast,
bulkreq.ubuffer, &done); bulkreq.ubuffer, &done);
} else { } else {
error = xfs_bulkstat(mp, NULL, &inlast, &count, error = xfs_bulkstat(mp, &inlast, &count,
(bulkstat_one_pf)xfs_bulkstat_one, NULL, (bulkstat_one_pf)xfs_bulkstat_one, NULL,
sizeof(xfs_bstat_t), bulkreq.ubuffer, sizeof(xfs_bstat_t), bulkreq.ubuffer,
BULKSTAT_FG_QUICK, &done); BULKSTAT_FG_QUICK, &done);
......
...@@ -1734,7 +1734,6 @@ xfs_qm_get_rtblks( ...@@ -1734,7 +1734,6 @@ xfs_qm_get_rtblks(
STATIC int STATIC int
xfs_qm_dqusage_adjust( xfs_qm_dqusage_adjust(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer - NULL */
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* not used */ void *buffer, /* not used */
int ubsize, /* not used */ int ubsize, /* not used */
...@@ -1766,7 +1765,7 @@ xfs_qm_dqusage_adjust( ...@@ -1766,7 +1765,7 @@ xfs_qm_dqusage_adjust(
* the case in all other instances. It's OK that we do this because * the case in all other instances. It's OK that we do this because
* quotacheck is done only at mount time. * quotacheck is done only at mount time.
*/ */
if ((error = xfs_iget(mp, tp, ino, XFS_ILOCK_EXCL, &ip, bno))) { if ((error = xfs_iget(mp, NULL, ino, XFS_ILOCK_EXCL, &ip, bno))) {
*res = BULKSTAT_RV_NOTHING; *res = BULKSTAT_RV_NOTHING;
return (error); return (error);
} }
...@@ -1903,7 +1902,7 @@ xfs_qm_quotacheck( ...@@ -1903,7 +1902,7 @@ 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, NULL, &lastino, &count, if ((error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_dqusage_adjust, NULL, xfs_qm_dqusage_adjust, NULL,
structsz, NULL, structsz, NULL,
BULKSTAT_FG_IGET|BULKSTAT_FG_VFSLOCKED, BULKSTAT_FG_IGET|BULKSTAT_FG_VFSLOCKED,
......
...@@ -1298,7 +1298,6 @@ xfs_qm_internalqcheck_dqadjust( ...@@ -1298,7 +1298,6 @@ xfs_qm_internalqcheck_dqadjust(
STATIC int STATIC int
xfs_qm_internalqcheck_adjust( xfs_qm_internalqcheck_adjust(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* not used */ void *buffer, /* not used */
int ubsize, /* not used */ int ubsize, /* not used */
...@@ -1327,7 +1326,7 @@ xfs_qm_internalqcheck_adjust( ...@@ -1327,7 +1326,7 @@ xfs_qm_internalqcheck_adjust(
ipreleased = B_FALSE; ipreleased = B_FALSE;
again: again:
lock_flags = XFS_ILOCK_SHARED; lock_flags = XFS_ILOCK_SHARED;
if ((error = xfs_iget(mp, tp, ino, lock_flags, &ip, bno))) { if ((error = xfs_iget(mp, NULL, ino, lock_flags, &ip, bno))) {
*res = BULKSTAT_RV_NOTHING; *res = BULKSTAT_RV_NOTHING;
return (error); return (error);
} }
...@@ -1405,7 +1404,7 @@ xfs_qm_internalqcheck( ...@@ -1405,7 +1404,7 @@ 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, NULL, &lastino, &count, if ((error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_internalqcheck_adjust, NULL, xfs_qm_internalqcheck_adjust, NULL,
0, NULL, BULKSTAT_FG_IGET, &done))) { 0, NULL, BULKSTAT_FG_IGET, &done))) {
break; break;
......
...@@ -55,14 +55,18 @@ ...@@ -55,14 +55,18 @@
#include "xfs_itable.h" #include "xfs_itable.h"
#include "xfs_error.h" #include "xfs_error.h"
#ifndef HAVE_USERACC
#define useracc(ubuffer, size, flags, foo) (0)
#define unuseracc(ubuffer, size, flags)
#endif
/* /*
* Return stat information for one inode. * Return stat information for one inode.
* Return 0 if ok, else errno. * Return 0 if ok, else errno.
*/ */
int /* error status */ int /* error status */
xfs_bulkstat_one( xfs_bulkstat_one(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* buffer to place output in */ void *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */ int ubsize, /* size of buffer */
...@@ -98,7 +102,7 @@ xfs_bulkstat_one( ...@@ -98,7 +102,7 @@ xfs_bulkstat_one(
/* We're not being passed a pointer to a dinode. This happens /* We're not being passed a pointer to a dinode. This happens
* if BULKSTAT_FG_IGET is selected. Do the iget. * if BULKSTAT_FG_IGET is selected. Do the iget.
*/ */
error = xfs_iget(mp, tp, ino, XFS_ILOCK_SHARED, &ip, bno); error = xfs_iget(mp, NULL, ino, XFS_ILOCK_SHARED, &ip, bno);
if (error) { if (error) {
*stat = BULKSTAT_RV_NOTHING; *stat = BULKSTAT_RV_NOTHING;
return error; return error;
...@@ -236,7 +240,6 @@ xfs_bulkstat_one( ...@@ -236,7 +240,6 @@ xfs_bulkstat_one(
int /* error status */ int /* error status */
xfs_bulkstat( xfs_bulkstat(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *lastinop, /* last inode returned */ xfs_ino_t *lastinop, /* last inode returned */
int *ubcountp, /* size of buffer/count returned */ int *ubcountp, /* 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 */
...@@ -311,13 +314,11 @@ xfs_bulkstat( ...@@ -311,13 +314,11 @@ xfs_bulkstat(
* Lock down the user's buffer. If a buffer was not sent, as in the case * Lock down the user's buffer. If a buffer was not sent, as in the case
* disk quota code calls here, we skip this. * disk quota code calls here, we skip this.
*/ */
#if defined(HAVE_USERACC)
if (ubuffer && if (ubuffer &&
(error = useracc(ubuffer, ubcount * statstruct_size, (error = useracc(ubuffer, ubcount * statstruct_size,
(B_READ|B_PHYS), NULL))) { (B_READ|B_PHYS), NULL))) {
return error; return error;
} }
#endif
/* /*
* Allocate a page-sized buffer for inode btree records. * Allocate a page-sized buffer for inode btree records.
* We could try allocating something smaller, but for normal * We could try allocating something smaller, but for normal
...@@ -333,7 +334,7 @@ xfs_bulkstat( ...@@ -333,7 +334,7 @@ xfs_bulkstat(
while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) { while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) {
bp = NULL; bp = NULL;
down_read(&mp->m_peraglock); down_read(&mp->m_peraglock);
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
up_read(&mp->m_peraglock); up_read(&mp->m_peraglock);
if (error) { if (error) {
/* /*
...@@ -347,7 +348,7 @@ xfs_bulkstat( ...@@ -347,7 +348,7 @@ xfs_bulkstat(
/* /*
* Allocate and initialize a btree cursor for ialloc btree. * Allocate and initialize a btree cursor for ialloc btree.
*/ */
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO,
(xfs_inode_t *)0, 0); (xfs_inode_t *)0, 0);
irbp = irbuf; irbp = irbuf;
irbufend = irbuf + nirbuf; irbufend = irbuf + nirbuf;
...@@ -461,7 +462,7 @@ xfs_bulkstat( ...@@ -461,7 +462,7 @@ xfs_bulkstat(
* when calling iget. * when calling iget.
*/ */
xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
xfs_trans_brelse(tp, agbp); xfs_buf_relse(agbp);
/* /*
* Now format all the good inodes into the user's buffer. * Now format all the good inodes into the user's buffer.
*/ */
...@@ -534,8 +535,8 @@ xfs_bulkstat( ...@@ -534,8 +535,8 @@ xfs_bulkstat(
ip->i_ino = ino; ip->i_ino = ino;
ip->i_mount = mp; ip->i_mount = mp;
if (bp) if (bp)
xfs_trans_brelse(tp, bp); xfs_buf_relse(bp);
error = xfs_itobp(mp, tp, ip, error = xfs_itobp(mp, NULL, ip,
&dip, &bp, bno); &dip, &bp, bno);
if (!error) if (!error)
clustidx = ip->i_boffset / mp->m_sb.sb_inodesize; clustidx = ip->i_boffset / mp->m_sb.sb_inodesize;
...@@ -580,7 +581,7 @@ xfs_bulkstat( ...@@ -580,7 +581,7 @@ xfs_bulkstat(
* in xfs_qm_quotacheck. * in xfs_qm_quotacheck.
*/ */
ubused = statstruct_size; ubused = statstruct_size;
error = formatter(mp, tp, ino, ubufp, error = formatter(mp, ino, ubufp,
ubleft, private_data, ubleft, private_data,
bno, &ubused, dip, &fmterror); bno, &ubused, dip, &fmterror);
if (fmterror == BULKSTAT_RV_NOTHING) { if (fmterror == BULKSTAT_RV_NOTHING) {
...@@ -603,7 +604,7 @@ xfs_bulkstat( ...@@ -603,7 +604,7 @@ xfs_bulkstat(
} }
if (bp) if (bp)
xfs_trans_brelse(tp, bp); xfs_buf_relse(bp);
/* /*
* Set up for the next loop iteration. * Set up for the next loop iteration.
...@@ -621,10 +622,8 @@ xfs_bulkstat( ...@@ -621,10 +622,8 @@ xfs_bulkstat(
* Done, we're either out of filesystem or space to put the data. * Done, we're either out of filesystem or space to put the data.
*/ */
kmem_free(irbuf, NBPC); kmem_free(irbuf, NBPC);
#if defined(HAVE_USERACC)
if (ubuffer) if (ubuffer)
unuseracc(ubuffer, ubcount * statstruct_size, (B_READ|B_PHYS)); unuseracc(ubuffer, ubcount * statstruct_size, (B_READ|B_PHYS));
#endif
*ubcountp = ubelem; *ubcountp = ubelem;
if (agno >= mp->m_sb.sb_agcount) { if (agno >= mp->m_sb.sb_agcount) {
/* /*
...@@ -667,7 +666,7 @@ xfs_bulkstat_single( ...@@ -667,7 +666,7 @@ xfs_bulkstat_single(
*/ */
ino = (xfs_ino_t)*lastinop; ino = (xfs_ino_t)*lastinop;
error = xfs_bulkstat_one(mp, NULL, ino, &bstat, sizeof(bstat), error = xfs_bulkstat_one(mp, ino, &bstat, sizeof(bstat),
NULL, 0, NULL, NULL, &res); NULL, 0, NULL, NULL, &res);
if (error) { if (error) {
/* /*
...@@ -676,7 +675,7 @@ xfs_bulkstat_single( ...@@ -676,7 +675,7 @@ xfs_bulkstat_single(
*/ */
(*lastinop)--; (*lastinop)--;
count = 1; count = 1;
if (xfs_bulkstat(mp, NULL, lastinop, &count, xfs_bulkstat_one, if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one,
NULL, NULL,
sizeof(bstat), buffer, BULKSTAT_FG_IGET, done)) sizeof(bstat), buffer, BULKSTAT_FG_IGET, done))
return error; return error;
...@@ -698,7 +697,6 @@ xfs_bulkstat_single( ...@@ -698,7 +697,6 @@ xfs_bulkstat_single(
int /* error status */ int /* error status */
xfs_inumbers( xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
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 */
xfs_caddr_t ubuffer) /* buffer with inode descriptions */ xfs_caddr_t ubuffer) /* buffer with inode descriptions */
...@@ -732,7 +730,7 @@ xfs_inumbers( ...@@ -732,7 +730,7 @@ xfs_inumbers(
while (left > 0 && agno < mp->m_sb.sb_agcount) { while (left > 0 && agno < mp->m_sb.sb_agcount) {
if (agbp == NULL) { if (agbp == NULL) {
down_read(&mp->m_peraglock); down_read(&mp->m_peraglock);
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
up_read(&mp->m_peraglock); up_read(&mp->m_peraglock);
if (error) { if (error) {
/* /*
...@@ -745,13 +743,13 @@ xfs_inumbers( ...@@ -745,13 +743,13 @@ xfs_inumbers(
agino = 0; agino = 0;
continue; continue;
} }
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, cur = xfs_btree_init_cursor(mp, NULL, agbp, agno,
XFS_BTNUM_INO, (xfs_inode_t *)0, 0); XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp);
if (error) { if (error) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
cur = NULL; cur = NULL;
xfs_trans_brelse(tp, agbp); xfs_buf_relse(agbp);
agbp = NULL; agbp = NULL;
/* /*
* Move up the the last inode in the current * Move up the the last inode in the current
...@@ -765,7 +763,7 @@ xfs_inumbers( ...@@ -765,7 +763,7 @@ xfs_inumbers(
if ((error = xfs_inobt_get_rec(cur, &gino, &gcnt, &gfree, if ((error = xfs_inobt_get_rec(cur, &gino, &gcnt, &gfree,
&i, ARCH_NOCONVERT)) || &i, ARCH_NOCONVERT)) ||
i == 0) { i == 0) {
xfs_trans_brelse(tp, agbp); xfs_buf_relse(agbp);
agbp = NULL; agbp = NULL;
xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
cur = NULL; cur = NULL;
...@@ -794,7 +792,7 @@ xfs_inumbers( ...@@ -794,7 +792,7 @@ xfs_inumbers(
if (error) { if (error) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
cur = NULL; cur = NULL;
xfs_trans_brelse(tp, agbp); xfs_buf_relse(agbp);
agbp = NULL; agbp = NULL;
/* /*
* The agino value has already been bumped. * The agino value has already been bumped.
...@@ -820,6 +818,6 @@ xfs_inumbers( ...@@ -820,6 +818,6 @@ xfs_inumbers(
xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR : xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
XFS_BTREE_NOERROR)); XFS_BTREE_NOERROR));
if (agbp) if (agbp)
xfs_trans_brelse(tp, agbp); xfs_buf_relse(agbp);
return error; return error;
} }
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
* see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
*/ */
typedef int (*bulkstat_one_pf)(struct xfs_mount *mp, typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
struct xfs_trans *tp,
xfs_ino_t ino, xfs_ino_t ino,
void *buffer, void *buffer,
int ubsize, int ubsize,
...@@ -69,7 +68,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp, ...@@ -69,7 +68,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
int /* error status */ int /* error status */
xfs_bulkstat( xfs_bulkstat(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
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 */
...@@ -89,7 +87,6 @@ xfs_bulkstat_single( ...@@ -89,7 +87,6 @@ xfs_bulkstat_single(
int int
xfs_bulkstat_one( xfs_bulkstat_one(
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_trans_t *tp,
xfs_ino_t ino, xfs_ino_t ino,
void *buffer, void *buffer,
int ubsize, int ubsize,
...@@ -102,7 +99,6 @@ xfs_bulkstat_one( ...@@ -102,7 +99,6 @@ xfs_bulkstat_one(
int /* error status */ int /* error status */
xfs_inumbers( xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *last, /* last inode returned */ xfs_ino_t *last, /* last inode returned */
int *count, /* size of buffer/count returned */ int *count, /* size of buffer/count returned */
xfs_caddr_t buffer);/* buffer with inode descriptions */ xfs_caddr_t buffer);/* buffer with inode descriptions */
......
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